I am bringing out a separate question from here. It really confused me. Here is the definition of add_mapping method:
def add_mapping(regexp, &proc) @test_mappings << [regexp, proc] end
How could proc here get executed and return result without using call method?
Eric, what add_mapping does is just adding a regular expresion + proc tuple to an array called @test_mappings.
add_mappings does not execute the proc. I don’t know how ZenTest works but it should be executing the procs after reading all add_mapping calls.
Check out the code for ZenTest and look out for @test_mappings, that could reveal you where (and when) the proc is executed.