diff options
author | Carl Lerche <carllerche@mac.com> | 2010-03-12 14:46:37 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-03-12 14:46:37 -0800 |
commit | e13420c86afb5c31e90cff800f121bd49255b939 (patch) | |
tree | 7089d188061b2a676143add52227e107a5cf9b45 /spec/engines/memory/unit/relations/skip_spec.rb | |
parent | 0b8b87fb947a746d4e58d11ea73ef20cfb23f576 (diff) | |
download | rails-e13420c86afb5c31e90cff800f121bd49255b939.tar.gz rails-e13420c86afb5c31e90cff800f121bd49255b939.tar.bz2 rails-e13420c86afb5c31e90cff800f121bd49255b939.zip |
We're obviously writing specs for arel. No need for a sub directory.
Diffstat (limited to 'spec/engines/memory/unit/relations/skip_spec.rb')
-rw-r--r-- | spec/engines/memory/unit/relations/skip_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/engines/memory/unit/relations/skip_spec.rb b/spec/engines/memory/unit/relations/skip_spec.rb new file mode 100644 index 0000000000..089db24cea --- /dev/null +++ b/spec/engines/memory/unit/relations/skip_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +module Arel + describe Skip do + before do + @relation = Array.new([ + [1, 'duck' ], + [2, 'duck' ], + [3, 'goose'] + ], [[:id, Attributes::Integer], [:name, Attributes::String]]) + end + + describe '#call' do + it 'removes the first n rows' do + @relation \ + .skip(1) \ + .let do |relation| + relation.call.should == [ + Row.new(relation, [2, 'duck']), + Row.new(relation, [3, 'goose']), + ] + end + end + end + end +end |