I was looking at some rspec sample code and came across this –
lambda {
@my_object.function
}.should raise_error(ArgumentError, "Unknown tag type")
Does this mean that rspec monkey patches the Proc object? Or otherwise how can I call the should method?
I probably wouldn’t call it monkey patching since it extends the core ruby Object class. But: yes, rspec will define the should method on Object so anything can be say that it should “something”