* Require allocates much less strigs in memory, and has the advantage that it will only require the same file once (it should never be a problem, as each run will wipe this cache) * Improves benchmark outputs so it has the commit SHA when it was run, for future reference * Adds allocation test
Ruby 1.9.3 has been EOLed (https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/), and thus support for it will no longer be given by M.
This is a refactor that should not affect any public facing methods. Handling different frameworks (or different versions of the same framework) was becoming messy really fast. The conditionals for each of them were scattered through the code. Thus, the solution was to use the strategy pattern (almost), and abstract the differences into what I called a runner. The different runners could not be injected into the initializer as a dependency, because at that point the testing framework is not yet loaded, which means there is no way of knowing what runner to use. So, it is lazy loaded, and only calculated when it is first used. Removed the main Runner class from the M module file, in order to make it simpler and easier to understand and reason about. The framework runner class now uses instance methods instead of class methods, mostly because of a personal preference, but also because I feel it instance methods are more flexible, and easier to change.
…eoljungberg-warning-free Conflicts: lib/m.rb test/minitest_test.rb test/options_test.rb
Uses Appraisal in order to test the different versions of minitest. The entire test suite will not run with minitest 5, since ruby relies on `Minitest::Unit::TestCase`, which was deprecated. Also, the previous solution was flawed since the `Minitest` constant was defined in minitest 4 as an alias to `MiniTest`, therefore I also check for the version number (`Minitest::Unit::VERSION`). I extracted the logic of checking which framework is loaded to a separate class, `M::Frameworks`, so it can be checked them on both the tests and the library code.
In the case of an empty test class similar to: class SomeTest < Test::Unit::TestCase end `m` was bombing out because `exit!` expects a non-nil value. The `Runner#run` method was only returning values in the case of tests that were found or tests not found within a file that does have tests. The third case of no tests at all was not being covered and would result in a `nil` being returned.