-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Let's say we have User model with has_many :devices relation.
If val is set to user.devices, consider the following:
[14] pry(#<RSpec::Matchers::BuiltIn::ChangeDetails>)> val.is_a? Enumerable
=> true
[15] pry(#<RSpec::Matchers::BuiltIn::ChangeDetails>)> val.is_a? Array
=> true
So far everything is good. But shouldn't the following tests also return true?
[16] pry(#<RSpec::Matchers::BuiltIn::ChangeDetails>)> Array === val
=> false
[17] pry(#<RSpec::Matchers::BuiltIn::ChangeDetails>)> Enumerable === val
=> false
You can find full repro here (all tests should pass):
https://github.com/knovoselic/rspec-expectations-change-bug-repro
I thought this was an rspec-expectations issue, but it turns out it's Mongoid issue. Please see this for more details:
https://github.com/rspec/rspec-expectations/issues/791