From 46da601b2f5507325bba279d5c12ed88ce9e685e Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Wed, 12 Mar 2008 00:12:41 -0700 Subject: more inadequate tests --- spec/active_relation/unit/primitives/attribute_spec.rb | 6 ++++-- spec/active_relation/unit/relations/table_spec.rb | 15 ++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'spec') diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/active_relation/unit/primitives/attribute_spec.rb index d424bf4dff..bdd22721b3 100644 --- a/spec/active_relation/unit/primitives/attribute_spec.rb +++ b/spec/active_relation/unit/primitives/attribute_spec.rb @@ -39,8 +39,10 @@ module ActiveRelation end describe '#column' do - it "" do - pending + it "returns the corresponding column in the relation" do + pending "damn mock based tests are too easy" + stub(@relation).column_for(@attribute) { 'bruisers' } + @attribute.column.should == 'bruisers' end end diff --git a/spec/active_relation/unit/relations/table_spec.rb b/spec/active_relation/unit/relations/table_spec.rb index e62f84d93a..6286ea9de1 100644 --- a/spec/active_relation/unit/relations/table_spec.rb +++ b/spec/active_relation/unit/relations/table_spec.rb @@ -65,6 +65,14 @@ module ActiveRelation Attribute.new(@relation, :name) ] end + + describe '#reset' do + it "reloads columns from the database" do + pending + lambda { stub(@relation.engine).columns { [] } }.should_not change { @relation.attributes } + lambda { @relation.reset }.should change { @relation.attributes } + end + end end describe '#qualify' do @@ -90,12 +98,5 @@ module ActiveRelation Table.new(:users, engine = Engine.new).engine.should == engine end end - - describe '#reset' do - it "reloads columns from the database" do - lambda { stub(@relation).columns { [] } }.should_not change { @relation.attributes } - lambda { @relation.reset }.should change { @relation.attributes } - end - end end end \ No newline at end of file -- cgit v1.2.3