rodjek/rspec-puppet — pull request #142 by doc75 (2013-12-27 23:35:54+00:00)
Title: fix bad syntax in the custom matcher run

If you modify the file spec/functions/split_spec.rb and add an extra s to /number of argumentss/, you will find the following failure:
Failure/Error: it { should run.with_params('foo').and_raise_error(expected_error, /number of argumentss/) }
ArgumentError:
wrong number of arguments (0 for 1)
# ./lib/rspec-puppet/matchers/run.rb:64:in `failure_message_for_should'
# ./spec/functions/split_spec.rb:15:in `block (2 levels) in '

Indeed the method failure_message_for_should and failure_message_for_should_not do not take any arguments.
the issue has not been seen since it requires a failing test that cannot be teste.

after the fix, the failure is now:
Failure/Error: it { should run.with_params('foo').and_raise_error(expected_error, /number of argumentss/) }
expected split("foo") to have raised ArgumentError
# ./spec/functions/split_spec.rb:15:in `block (2 levels) in '

This is the correct expected message.

I also added a description to the matcher to avoid the rspec warning message

I do not know how to test this kind of situation (failure of a matcher).