You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example fails only when the 'delegate' library is required before 'rspec', on 1.9 (jruby and mri).
You can also observe this problem by running the specs of rspec-expectations:
RUBYOPT=-rdelegate rake spec
The "arbitrary predicate with DelegateClass"/"accesses methods defined in the delegating class (LH[#48])" (spec/rspec/matchers/be_spec.rb#412) example is indeed testing similar behavior.
I guess the problem mainly lies in lib/delegate.rb which changed a lot from 1.8 on 1.9, notably by using BasicObject. There is some dark magic there, like Kernel.dup.
Until the problem is found, I think RSpec should emit a warning (or abort) when 'delegate' is required before 'rspec' to help users hitting this bug.
What do you think?
The text was updated successfully, but these errors were encountered:
This bug is really weird, I searched what caused it during a few hours.
It is probably similar to: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11526&group_id=797
I tried to find more info about it but did not succeed.
Could you give me access to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/48-11526-rspec-fails-to-dynamically-bind-delegateclass-methods#ticket-48-2 ?
Here is a small reproducing example:
The example fails only when the 'delegate' library is required before 'rspec', on 1.9 (jruby and mri).
You can also observe this problem by running the specs of rspec-expectations:
The "arbitrary predicate with DelegateClass"/"accesses methods defined in the delegating class (LH[#48])" (spec/rspec/matchers/be_spec.rb#412) example is indeed testing similar behavior.
I guess the problem mainly lies in
lib/delegate.rb
which changed a lot from 1.8 on 1.9, notably by using BasicObject. There is some dark magic there, likeKernel.dup
.Until the problem is found, I think RSpec should emit a warning (or abort) when 'delegate' is required before 'rspec' to help users hitting this bug.
What do you think?
The text was updated successfully, but these errors were encountered: