diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 15:44:03 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 15:44:03 -0400 |
commit | b7f58db57a535806e0cfc3057fbab80ca43b1a53 (patch) | |
tree | 987ef15b24bbb0cab7edd43c61618fbf46ce02fa /spec/arel/engines/memory/unit/relations/project_spec.rb | |
parent | 8339f024c7663133a78c4d0a8824b5b6fafaf239 (diff) | |
download | rails-b7f58db57a535806e0cfc3057fbab80ca43b1a53.tar.gz rails-b7f58db57a535806e0cfc3057fbab80ca43b1a53.tar.bz2 rails-b7f58db57a535806e0cfc3057fbab80ca43b1a53.zip |
better test ordering
Conflicts:
doc/TODO
Diffstat (limited to 'spec/arel/engines/memory/unit/relations/project_spec.rb')
-rw-r--r-- | spec/arel/engines/memory/unit/relations/project_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/arel/engines/memory/unit/relations/project_spec.rb b/spec/arel/engines/memory/unit/relations/project_spec.rb new file mode 100644 index 0000000000..1d1224cfdc --- /dev/null +++ b/spec/arel/engines/memory/unit/relations/project_spec.rb @@ -0,0 +1,27 @@ +require File.join(File.dirname(__FILE__), '..', '..', '..', '..', '..', 'spec_helper') + +module Arel + describe Project do + before do + @relation = Array.new([ + [1, 'duck' ], + [2, 'duck' ], + [3, 'goose'] + ], [:id, :name]) + end + + describe '#call' do + it 'retains only the attributes that are provided' do + @relation \ + .project(@relation[:id]) \ + .let do |relation| + relation.call.should == [ + Row.new(relation, [1]), + Row.new(relation, [2]), + Row.new(relation, [3]) + ] + end + end + end + end +end
\ No newline at end of file |