Skip to content
Browse files

Fix Virtus::ValueObject::Equalizer#<< spec for jruby in 1.9 mode

  • Loading branch information...
1 parent b8ca28c commit 014b278a79847b6dda892b07020a800c5243311b @solnic committed Mar 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 spec/unit/virtus/value_object/equalizer/append_spec.rb
2 spec/unit/virtus/value_object/equalizer/append_spec.rb
@@ -55,7 +55,7 @@
describe "#hash" do
subject { user_one.hash }
- it { should be(klass.hash ^ first_name.hash ^ last_name.hash) }
+ it { should eql(klass.hash ^ first_name.hash ^ last_name.hash) }

2 comments on commit 014b278

dkubb commented on 014b278 Mar 22, 2012

Yeah, in JRuby when the hash value is calculated under the hood it uses the built-in Java object's own equivalent hashCode() methods, and then coerces then into Ruby Fixnum objects. They don't use any kind of global registry, so two Fixnum objects returned from #hash usually have different object_id values.

solnic commented on 014b278 Mar 22, 2012

@dkubb right, I remember hitting this in DM1 specs too

Please sign in to comment.
Something went wrong with that request. Please try again.