Skip to content

Instantly share code, notes, and snippets.

@joshuaclayton
Created October 2, 2012 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaclayton/3822920 to your computer and use it in GitHub Desktop.
Save joshuaclayton/3822920 to your computer and use it in GitHub Desktop.
Attempt at ensuring a test takes at most four seconds before failing
/Users/joshuaclayton/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/formatters/base_text_formatter.rb:181:in `dump_failure_info': You have a nil object when you didn't expect it! (NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
around do |example|
begin
Timeout::timeout(4) do
example.run
end
rescue Timeout::Error => e
fail 'Test took too long to complete'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment