Skip to content
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
Closed

Script helper for activities that should cause an exception #498

ryanatball opened this issue Jun 28, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@ryanatball
Copy link
Member

@ryanatball 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 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.