diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2007-12-30 13:22:31 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2007-12-30 13:22:31 -0800 |
commit | f9cc8bba39b1deb6b3f70cecb96beaf988054915 (patch) | |
tree | de8bc118ee34c5870f0175c05298f9ab39250617 /spec/relations/relation_spec.rb | |
parent | 960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d (diff) | |
download | rails-f9cc8bba39b1deb6b3f70cecb96beaf988054915.tar.gz rails-f9cc8bba39b1deb6b3f70cecb96beaf988054915.tar.bz2 rails-f9cc8bba39b1deb6b3f70cecb96beaf988054915.zip |
various
Diffstat (limited to 'spec/relations/relation_spec.rb')
-rw-r--r-- | spec/relations/relation_spec.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/spec/relations/relation_spec.rb b/spec/relations/relation_spec.rb index c482eb4a01..7434bd563b 100644 --- a/spec/relations/relation_spec.rb +++ b/spec/relations/relation_spec.rb @@ -12,19 +12,17 @@ describe Relation do end end - describe Relation, 'attributes' do - end - describe Relation, '[]' do it "manufactures a attribute" do @relation1[:id].should be_eql(Attribute.new(@relation1, :id)) end it "raises an error if the named attribute is not part of the relation" do + pending end end - describe Relation, 'include?' do + describe Relation, '#include?' do before do @attribute = Attribute.new(@relation1, :id) end @@ -34,19 +32,32 @@ describe Relation do end end - describe Relation, 'project' do + describe Relation, '#project' do before do @attribute1 = Attribute.new(@relation1, :id) @attribute2 = Attribute.new(@relation1, :name) end it "only allows projecting attributes in the relation" do + pending end it "collapses identical projections" do + pending + end + + it "manufactures a projected relation" do + @relation1.project(@attribute1, @attribute2).should == ProjectedRelation(@relation1, @attribute1, @attribute2) end end - describe Relation, 'select' do + describe Relation, '#select' do + before do + @predicate = EqualityPredicate.new() + end + + it "manufactures a selected relation" do + @relation1.select(@attribute1, @attribute2).should == SelectedRelation(@relation1, @attribute1, @attribute2) + end end end
\ No newline at end of file |