Sha256: 84dca2d1af3b85f3e06d21d120219e658cd33dff1c0a0cc65d4118377c11c4b7
Contents?: true
Size: 470 Bytes
Versions: 9
Compression:
Stored size: 470 Bytes
Contents
Then(/^I(?: can)? run the code:$/) do |code| @result = eval(code).tap do |result| puts result if ENV['DEBUG'] end end Then(/^this code should fail with "([^"]*)"$/) do |error_msg, code| begin @result = eval(code) rescue Exception => exc if not exc.message =~ %r{#{error_msg}} fail "'#{error_msg}' was not found in '#{exc.message}'" end else puts @result if ENV['DEBUG'] fail "The provided block did not raise an error" end end
Version data entries
9 entries across 9 versions & 1 rubygems