jstrait / wavefile

A Ruby gem for reading and writing sound files in Wave format (*.wav)
https://wavefilegem.com
MIT License
208 stars 24 forks source link

Upgrading to the latest version of MiniTest #20

Closed jstrait closed 8 years ago

jstrait commented 8 years ago

This involves changing usage of MiniTest::Unit::TestCase into Minitest::Test.

Since this change will cause tests to fail on versions of Ruby 2.1 and earlier, due to them having an older version of the Minitest gem built in, this commit also introduces a Gemfile that specifies a more modern version of Minitest. This means that tests now need to be run using bundle exec rake test, instead of rake test.

jstrait commented 8 years ago

@hzulla FYI

hzulla commented 8 years ago

So the gem works with ruby 1.9.3+, but the tests require ruby 2.1+?

jstrait commented 8 years ago

@hzulla this gem works with Ruby 1.9.3+.

Before this PR, the test suite would pass with Ruby 1.9.3 and up. However, in Ruby 2.2 or 2.3 it would give the MiniTest::Unit::TestCase is now Minitest::Test warning you mentioned in the other PR.

The reason for the warning is the Ruby 2.2 and 2.3 use a newer version of MiniTest by default. In this newer version, MiniTest::Unit::TestCase has been renamed to Minitest::Test. Ruby 1.9.3 through Ruby 2.1 use an older version of MiniTest by default.

When the test were changed to use Minitest::Test, this removed the warnings in Ruby 2.2 and 2.3, but caused the tests to fail due to errors in Ruby 1.9.3 through 2.1.

This PR fixes the problem by adding a Gemfile so that the newer version of MiniTest is used regardless of the Ruby version, instead of the default version of MiniTest in whatever version of Ruby is being used. However, as a result the tests now need to be run using bundle exec rake test (instead of rake test), to ensure that the newer version of MiniTest is used.

jstrait commented 8 years ago

@hzulla merging this in, let me know if you have any questions!