The following code (which has no Gemfile) works on Ruby 2.1.1, but not Ruby 2.2.0
require "bundler/setup"
gem "minitest", "4.7.5"
require "test/unit"
class TestFoo < Test::Unit::TestCase
def test_foo
assert true, "Useless mesage"
skip "Skip works"
end
end
On Ruby 2.1.1, I get
Run options:
# Running tests:
[1/1] TestFoo#test_foo = 0.00 s
1) Skipped:
TestFoo#test_foo [test_220.rb:8]:
Skip works
Finished tests in 0.004435s, 225.4791 tests/s, 225.4791 assertions/s.
1 tests, 1 assertions, 0 failures, 0 errors, 1 skips
ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin10.0]
But on Ruby 2.2.0, I get
192-168-1-5:test_220 agrimm$ ruby test_220.rb
Loaded suite test_220
Started
E
===============================================================================
Error: test_foo(TestFoo)
: NoMethodError: undefined method `skip' for #<TestFoo:0x007fb75484f158>
test_220.rb:8:in `test_foo'
5: class TestFoo < Test::Unit::TestCase
6: def test_foo
7: assert true, "Useless mesage"
=> 8: skip "Skip works"
9: end
10: end
===============================================================================
Finished in 0.001504 seconds.
1 tests, 1 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
664.89 tests/s, 664.89 assertions/s
$ ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
I suspect that this is because of changes associated with Ruby 2.2.0:
Update test-unit 3.0.8 (removed from repository but bundled in tarball)
Update minitest 5.4.3 (removed from repository but bundled in tarball)
How do I make the code work on Ruby 2.2, preferably with the least amount of code change?