aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/unit/relations/table_spec.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-02 17:56:18 -0800
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-02 17:56:18 -0800
commitc54392872f024d55e8a23ead3065e6119a52b234 (patch)
tree905aee0f7c40436ff41979227e9eb72e4a6840ba /spec/active_relation/unit/relations/table_spec.rb
parent86550ef2bee377a5e4134dc63dedb138bb9ab7dc (diff)
downloadrails-c54392872f024d55e8a23ead3065e6119a52b234.tar.gz
rails-c54392872f024d55e8a23ead3065e6119a52b234.tar.bz2
rails-c54392872f024d55e8a23ead3065e6119a52b234.zip
introduced engine dependency for sql strategies
- hacked in default engine for scalars -- BAD
Diffstat (limited to 'spec/active_relation/unit/relations/table_spec.rb')
-rw-r--r--spec/active_relation/unit/relations/table_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/active_relation/unit/relations/table_spec.rb b/spec/active_relation/unit/relations/table_spec.rb
index 5c7fa35e63..8f14ce33cf 100644
--- a/spec/active_relation/unit/relations/table_spec.rb
+++ b/spec/active_relation/unit/relations/table_spec.rb
@@ -80,5 +80,16 @@ module ActiveRelation
hash[Table.new(:users)].should == 1
end
end
+
+ describe '#engine' do
+ it "defaults to global engine" do
+ Table.engine = engine = Engine.new
+ Table.new(:users).engine.should == engine
+ end
+
+ it "can be specified" do
+ Table.new(:users, engine = Engine.new).engine.should == engine
+ end
+ end
end
end \ No newline at end of file