Skip to content

Instantly share code, notes, and snippets.

@porras
Created February 6, 2013 11:46
Show Gist options
  • Select an option

  • Save porras/4722105 to your computer and use it in GitHub Desktop.

Select an option

Save porras/4722105 to your computer and use it in GitHub Desktop.
Given /^I randomly fail (\d+)% of the time$/ do |i|
r = rand
t = i.to_i / 100.0
raise 'RandomFailure' if r < t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment