lib/assay/assertions/execution_failure.rb in assay-0.2.0 vs lib/assay/assertions/execution_failure.rb in assay-0.3.0
- old
+ new
@@ -32,10 +32,11 @@
end
end
#
def to_s
+ return @mesg if @mesg
if @_negated
"Expected procedure to raise an exception"
else
"Expected procedure to execute successfully"
end
@@ -49,23 +50,21 @@
#
# assert_executes "Couldn't do the thing" do
# do_the_thing
# end
#
- def assert_executes(opts={}, &blk)
- opts[:backtrace] ||= caller
- ExecutionFailure.assert(opts, &blk)
+ def assert_executes(msg=nil, &blk)
+ ExecutionFailure.assert(:message=>msg, :backtrace=>caller, &blk)
end
# Passes if the block does not yield successfully.
#
# assert_not_executes "Couldn't do the thing" do
# do_the_thing
# end
#
- def assert_not_executes(opts={}, &blk)
- opts[:backtrace] ||= caller
- ExecutionFailure.refute(opts, &blk)
+ def assert_not_executes(msg=nil, &blk)
+ ExecutionFailure.refute(:message=>msg, :backtrace=>caller, &blk)
end
end
module Matchers