New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script helper for activities that should cause an exception #498

Closed
ryanatball opened this Issue Jun 28, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@ryanatball
Member

ryanatball commented Jun 28, 2017

Create a scripting helper method to check for expected exceptions. Something like:

def check_exception(method_name, *method_args)
begin
send(method_name, method_args)
raise Cosmos::CheckError, "#{method_name}(#{method_args.join(", ")}) should have produced an exception but did not."
rescue => e
puts "#{method_name}(#{method_args.join(", ")}) generated #{e.class} exception as expected"
end
end

@ryanatball ryanatball added the feature label Jun 28, 2017

@jasonatball jasonatball self-assigned this Jul 6, 2017

@ryanatball ryanatball closed this in #503 Jul 21, 2017

@ryanatball ryanatball modified the milestone: v4.0.0 Aug 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment