diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-09-20 12:59:32 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-09-20 12:59:32 -0400 |
commit | 927d8b8cde930244a16215c57896c8e45f616d0f (patch) | |
tree | 0edfba7f236dddb2a3585a591588c21651dbb8b7 /spec/arel/algebra | |
parent | 6690e3c007f65a39797a92462aaabf564bc709b4 (diff) | |
download | rails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.gz rails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.bz2 rails-927d8b8cde930244a16215c57896c8e45f616d0f.zip |
Fix almost all Ruby warnings during spec suite
Diffstat (limited to 'spec/arel/algebra')
5 files changed, 8 insertions, 10 deletions
diff --git a/spec/arel/algebra/unit/predicates/equality_spec.rb b/spec/arel/algebra/unit/predicates/equality_spec.rb index c917520158..01917842f6 100644 --- a/spec/arel/algebra/unit/predicates/equality_spec.rb +++ b/spec/arel/algebra/unit/predicates/equality_spec.rb @@ -11,7 +11,7 @@ module Arel describe '==' do it "obtains if attribute1 and attribute2 are identical" do - Equality.new(@attribute1, @attribute2).should == Equality.new(@attribute1, @attribute2) + check Equality.new(@attribute1, @attribute2).should == Equality.new(@attribute1, @attribute2) Equality.new(@attribute1, @attribute2).should_not == Equality.new(@attribute1, @attribute1) end diff --git a/spec/arel/algebra/unit/primitives/attribute_spec.rb b/spec/arel/algebra/unit/primitives/attribute_spec.rb index cd484007e1..93b661c6fc 100644 --- a/spec/arel/algebra/unit/primitives/attribute_spec.rb +++ b/spec/arel/algebra/unit/primitives/attribute_spec.rb @@ -73,10 +73,8 @@ module Arel describe 'when dividing two matching attributes' do it 'returns a the highest score for the most similar attributes' do - (@aliased_relation[:id] / @relation[:id]) \ - .should == (@aliased_relation[:id] / @relation[:id]) - (@aliased_relation[:id] / @relation[:id]) \ - .should < (@aliased_relation[:id] / @aliased_relation[:id]) + check((@aliased_relation[:id] / @relation[:id]).should == (@aliased_relation[:id] / @relation[:id])) + (@aliased_relation[:id] / @relation[:id]).should < (@aliased_relation[:id] / @aliased_relation[:id]) end end end diff --git a/spec/arel/algebra/unit/relations/alias_spec.rb b/spec/arel/algebra/unit/relations/alias_spec.rb index 2aa4d52d99..eaf31652b9 100644 --- a/spec/arel/algebra/unit/relations/alias_spec.rb +++ b/spec/arel/algebra/unit/relations/alias_spec.rb @@ -8,7 +8,7 @@ module Arel describe '==' do it "obtains if the objects are the same" do - Alias.new(@relation).should_not == Alias.new(@relation) + check Alias.new(@relation).should_not == Alias.new(@relation) (aliaz = Alias.new(@relation)).should == aliaz end end diff --git a/spec/arel/algebra/unit/relations/relation_spec.rb b/spec/arel/algebra/unit/relations/relation_spec.rb index 0a08deffb8..2688ece4a5 100644 --- a/spec/arel/algebra/unit/relations/relation_spec.rb +++ b/spec/arel/algebra/unit/relations/relation_spec.rb @@ -17,8 +17,8 @@ module Arel describe 'when given a', Symbol, String do it "returns the attribute with the same name, if it exists" do - @relation[:id].should == @attribute1 - @relation['id'].should == @attribute1 + check @relation[:id].should == @attribute1 + check @relation['id'].should == @attribute1 @relation[:does_not_exist].should be_nil end end @@ -180,7 +180,7 @@ module Arel describe Relation::Enumerable do it "implements enumerable" do - @relation.collect.should == @relation.session.read(@relation).collect + check @relation.collect.should == @relation.session.read(@relation).collect @relation.first.should == @relation.session.read(@relation).first end end diff --git a/spec/arel/algebra/unit/relations/table_spec.rb b/spec/arel/algebra/unit/relations/table_spec.rb index e4c4e58b75..19c1ba2bea 100644 --- a/spec/arel/algebra/unit/relations/table_spec.rb +++ b/spec/arel/algebra/unit/relations/table_spec.rb @@ -9,7 +9,7 @@ module Arel describe '[]' do describe 'when given a', Symbol do it "manufactures an attribute if the symbol names an attribute within the relation" do - @relation[:id].should == Attribute.new(@relation, :id) + check @relation[:id].should == Attribute.new(@relation, :id) @relation[:does_not_exist].should be_nil end end |