Browse files

Fix spec issues with Rubinius.

* Rubinius is very public with its core Module methods.
* Rubinius sorts hash keys differently and we shouldn't rely on the order.
  • Loading branch information...
1 parent fa67f9a commit 695b32ca9216a90440c7cd6430ef9b8b56ffd9b4 @cgriego cgriego committed Jun 19, 2011
Showing with 5 additions and 7 deletions.
  1. +2 −2 spec/functional/mongoid/dirty_spec.rb
  2. +3 −5 spec/unit/mongoid/criteria_spec.rb
View
4 spec/functional/mongoid/dirty_spec.rb
@@ -35,7 +35,7 @@
end
it "marks changed fields" do
- person.changed.should == [ "title", "ssn", "some_dynamic_field" ]
+ person.changed.should =~ [ "title", "ssn", "some_dynamic_field" ]
end
it "marks the field as changed" do
@@ -53,7 +53,7 @@
it "allows reset of field changes" do
person.reset_title!
person.title.should == "MC"
- person.changed.should == [ "ssn", "some_dynamic_field" ]
+ person.changed.should =~ [ "ssn", "some_dynamic_field" ]
end
context "after a save" do
View
8 spec/unit/mongoid/criteria_spec.rb
@@ -378,7 +378,6 @@
end
end
-
describe "#clone" do
let(:criteria) do
@@ -858,7 +857,6 @@
end
end
-
describe "#respond_to?" do
let(:criteria) do
@@ -874,7 +872,7 @@
end
it "is false when asking about a model's private class method even when including private methods" do
- criteria.respond_to?(:include, true).should be_false
+ criteria.respond_to?(:alias_method, true).should be_false
end
it "is true when asking about a criteria's entries' instance method" do
@@ -894,11 +892,11 @@
end
it "is false when asking about a private criteria instance method without including private methods" do
- criteria.respond_to?(:initialize).should be_false
+ criteria.respond_to?(:gsub).should be_false
end
it "is true when asking about a private criteria instance method when including private methods" do
- criteria.respond_to?(:initialize, true).should be_true
+ criteria.respond_to?(:gsub, true).should be_true
end
end

0 comments on commit 695b32c

Please sign in to comment.