GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Ruby's default rescue only handles StandardError subclasses. This is a problem when testing for exceptions that don't inherit from StandardError. The standard timeout library is one such offender: Timeout::Error inherits from Interrupt.
This is causing a test in redis-rb to fail, which is what led me here (see packagethief/redis-rb@b5dd841).
I'm not sure about packagethief@958519a. Prior to this change, these tests were failing due to differences in backtrace formatting (./test/fixtures/failure.rb vs. test/fixtures/failure.rb). If they weren't failing for anyone else, just ignore; it's possible that it's version specific (I tested using 1.8.7 p253).
Update output expectations
Revise assert_raise to rescue any kind of Exception; the default only…
… covers StandardError and subclasses
This is a problem when testing for exceptions that don't inherit from StandardError.
Ruby's timeout library is a notable offender: Timeout::Error < Interrupt.
I think I also got this error, I'm building a deb package for cutest and running its own tests fail for me.
pravi@savannah:/media/forge/debian/diaspora/ruby-cutest-1.1.3$ cutest test/run.rb
Cutest::AssertionFailed: "\e[01;36m\n\nCutest::AssertionFailed: \e[1;33mexpression returned false\n\n\e[00m\e[00m- assert false\e[01;30m ./test/fixtures/failure.rb +2\n\e[00m\n" != "\e[01;36m\n\nCutest::AssertionFailed: \e[1;33mexpression returned false\n\n\e[00m- assert false\e[01;30m test/fixtures/failure.rb +2\n\e[00m\n"
- assert_equal(stdout, expected) ./test/run.rb +32
pravi@savannah:/media/forge/debian/diaspora/ruby-cutest-1.1.3$ echo $?
This patch doesn't apply any more! test fails with both 1.8.7 and 1.9.2 versions or ruby.
Tested with versions
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
packagethief, can you re-base your changes to current cutest revision?
hi can anyone rebase this patch to current version?
My sincerest apologies for not attending to this issue before. If you're trying to fix assert_raise under a timeout condition, can you please add a test for such a case? Thank you.