Test failure on JRuby 1.6.0
Created by: kaiwren
Running rake for rspec-mocks against Jruby-1.6.0 on OSX against ef127a56 has nil_expectation_warning_spec.rb fail with the trace given at the end of this ticket.
The failure seems to be occurring because jruby returns a failure trace with
Called from #{FILE}:#{LINE+3}:in (class Mocks)' instead of what CRuby returns which is Called from #{__FILE__}:#{__LINE__+3}(:in
block (2 levels) in module:Mocks
These strings are generated by caller[4]
so this might actually be a JRuby issue (which I will check and confirm).
Trace:
1) an expectation set on nil issues a warning with file and line number information
Failure/Error: nil.should_receive(:foo)
Kernel received :warn with unexpected arguments
expected: (/An expectation of :foo was set on nil. Called from /Users/sidu/Work/Rspec/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb:21(:in block \(2 levels\) in <module:Mocks>')?. Use allow_message_expectations_on_nil to disable warnings./) got: ("An expectation of :foo was set on nil. Called from /Users/sidu/Work/Rspec/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb:21:in
(class Mocks)'. Use allow_message_expectations_on_nil to disable warnings.")
# ./spec/rspec/mocks/nil_expectation_warning_spec.rb:21:in (class Mocks)' # org/jruby/RubyKernel.java:2007:in
instance_eval'
# org/jruby/RubyArray.java:2306:in collect' # org/jruby/RubyArray.java:2306:in
collect'