Ruby 1.8.7 receive-with-block failure on 2.14.x and 2.99.0.beta1 (but not 2.13.x and 3.0.0.beta1)
Created by: lamont-granquist
This is failing for me specifically on the 2.14.x and 2.99.x branches of rspec and specifically for ruby 1.8.7 and not for 1.9/2.0/2.1.
class Thing
def request(one, two, three, &proc)
puts one
puts two
puts three
puts "i got a block" if block_given?
end
end
describe "when failure is not an option" do
it "should not fail" do
thing = Thing.new
saved_method = thing.method(:request)
thing.should_receive(:request) do |arg1, arg2, arg3, &proc|
arg2.should_not be_nil
arg3.should_not be_nil
saved_method.call(arg1, arg2, arg3, &proc)
end
thing.request("foo", "bar", "baz") do
puts "arglebargle"
end
end
end
This came up as a part of trying to modernize Chef's existing rspec 2.13.x dependency to 2.14.x and dealing with this test:
Not sure if you care to fix in 2.99 or whatever. I think I'm going to mark that spec as broken in 1.8.7 due to this bug and move on with my life...