m 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby-ci.yml +3 -3
  3. data/.gitignore +1 -0
  4. data/.standard.yml +1 -0
  5. data/Gemfile +4 -6
  6. data/README.md +3 -25
  7. data/Rakefile +34 -82
  8. data/bin/m +2 -2
  9. data/gemfiles/minitest4.gemfile +2 -4
  10. data/gemfiles/minitest5.gemfile +2 -4
  11. data/gemfiles/test_unit_gem.gemfile +2 -4
  12. data/lib/error_tests/error_test.rb +1 -1
  13. data/lib/m/executor.rb +19 -23
  14. data/lib/m/frameworks.rb +20 -16
  15. data/lib/m/parser.rb +30 -31
  16. data/lib/m/runner.rb +3 -3
  17. data/lib/m/runners/base.rb +4 -4
  18. data/lib/m/runners/minitest_4.rb +1 -1
  19. data/lib/m/runners/minitest_5.rb +3 -5
  20. data/lib/m/runners/test_unit.rb +6 -6
  21. data/lib/m/runners/unsupported_framework.rb +2 -2
  22. data/lib/m/test_collection.rb +5 -5
  23. data/lib/m/test_method.rb +5 -5
  24. data/lib/m/testable.rb +2 -2
  25. data/lib/m/version.rb +1 -1
  26. data/lib/m.rb +4 -4
  27. data/m.gemspec +13 -14
  28. data/test/Rakefile +2 -2
  29. data/test/active_support_test.rb +17 -17
  30. data/test/allocations.rb +11 -13
  31. data/test/bench.rb +9 -9
  32. data/test/empty_test.rb +2 -2
  33. data/test/everything_test.rb +7 -7
  34. data/test/examples/active_support_example_test.rb +2 -5
  35. data/test/examples/active_support_unescaped_example_test.rb +2 -5
  36. data/test/examples/empty_example_test.rb +1 -1
  37. data/test/examples/minitest_4_example_test.rb +1 -1
  38. data/test/examples/minitest_5_example_test.rb +1 -1
  39. data/test/examples/minitest_example_test.rb +2 -2
  40. data/test/examples/multiple_example_test.rb +3 -3
  41. data/test/examples/subdir/a_test.rb +1 -1
  42. data/test/examples/subdir/another_subdir/d_test.rb +1 -1
  43. data/test/examples/subdir/another_subdir/yet_another_subdir/e_test.rb +1 -1
  44. data/test/examples/subdir/b_test.rb +1 -1
  45. data/test/examples/subdir/c_test.rb +1 -1
  46. data/test/examples/subdir_with_failures/a_test.rb +1 -1
  47. data/test/examples/test_unit_example_test.rb +2 -2
  48. data/test/exit_codes_test.rb +6 -6
  49. data/test/minitest_4_test.rb +7 -7
  50. data/test/minitest_5_test.rb +8 -8
  51. data/test/multiple_test.rb +4 -4
  52. data/test/options_test.rb +14 -14
  53. data/test/test_helper.rb +15 -17
  54. data/test/test_unit_test.rb +9 -9
  55. metadata +11 -69
  56. data/.travis.yml +0 -19
  57. data/Appraisals +0 -11
  58. data/Gemfile.lock +0 -74
  59. data/gemfiles/minitest4.gemfile.lock +0 -73
  60. data/gemfiles/minitest5.gemfile.lock +0 -73
  61. data/gemfiles/test_unit_gem.gemfile.lock +0 -76
@@ -6,14 +6,14 @@ module M
6
6
  []
7
7
  end
8
8
 
9
- def run(_test_arguments)
9
+ def run _test_arguments
10
10
  not_supported
11
11
  end
12
12
 
13
13
  private
14
14
 
15
15
  def not_supported
16
- STDERR.puts "This test framework is not supported! Please open up an issue at https://github.com/qrush/m !"
16
+ warn "This test framework is not supported! Please open up an issue at https://github.com/qrush/m !"
17
17
  false
18
18
  end
19
19
  end
@@ -11,18 +11,18 @@ module M
11
11
  # internal collection
12
12
  def_delegators :@collection, :size, :<<, :each
13
13
 
14
- def initialize(collection = nil)
14
+ def initialize collection = nil
15
15
  @collection = collection || []
16
16
  end
17
17
 
18
18
  # Slice out tests that may be within the given line.
19
19
  # Returns a new TestCollection with the results.
20
- def within(lines)
20
+ def within lines
21
21
  # Into a new collection, filter only the tests that...
22
22
  collection = select do |test|
23
- lines.none? || lines.any? { |line| (test.start_line..test.end_line).include?(line) }
23
+ lines.none? || lines.any? { |line| (test.start_line..test.end_line).cover?(line) }
24
24
  end
25
- self.class.new(collection)
25
+ self.class.new collection
26
26
  end
27
27
 
28
28
  # Used to line up method names in `#sprintf` when `m` aborts
@@ -33,7 +33,7 @@ module M
33
33
  end
34
34
 
35
35
  # Be considerate when printing out tests and pre-sort them by line number
36
- def by_line_number(&block)
36
+ def by_line_number &block
37
37
  # On each member of the collection, sort by line number and yield
38
38
  # the block into the sorted collection
39
39
  sort_by(&:start_line).each(&block)
data/lib/m/test_method.rb CHANGED
@@ -8,12 +8,12 @@ module M
8
8
  #
9
9
  # Includes the name of this method, what line on the file it begins on,
10
10
  # and where it ends.
11
- class TestMethod < Struct.new(:name, :start_line, :end_line)
11
+ TestMethod = Struct.new :name, :start_line, :end_line do
12
12
  # Set up a new test method for this test suite class
13
- def self.create(suite_class, test_method)
13
+ def self.create suite_class, test_method
14
14
  # Hopefully it's been defined as an instance method, so we'll need to
15
15
  # look up the ruby Method instance for it
16
- method = suite_class.instance_method(test_method)
16
+ method = suite_class.instance_method test_method
17
17
 
18
18
  # Ruby can find the starting line for us, so pull that out of the array
19
19
  start_line = method.source_location.last
@@ -24,11 +24,11 @@ module M
24
24
  #
25
25
  # The end line should be the number of line breaks in the method source,
26
26
  # added to the starting line and subtracted by one.
27
-
27
+
28
28
  end_line = method.source.split("\n").size + start_line - 1
29
29
 
30
30
  # Shove the given attributes into a new databag
31
- new(test_method, start_line, end_line)
31
+ new test_method, start_line, end_line
32
32
  end
33
33
  end
34
34
  end
data/lib/m/testable.rb CHANGED
@@ -3,14 +3,14 @@ module M
3
3
  attr_accessor :file, :recursive, :passthrough_options
4
4
  attr_reader :lines
5
5
 
6
- def initialize(file = "", lines = [], recursive = false)
6
+ def initialize file = "", lines = [], recursive = false
7
7
  @file = file
8
8
  @recursive = recursive
9
9
  @passthrough_options = []
10
10
  self.lines = lines
11
11
  end
12
12
 
13
- def lines=(lines)
13
+ def lines= lines
14
14
  @lines = lines.map(&:to_i)
15
15
  end
16
16
  end
data/lib/m/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module M
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.2".freeze
3
3
  end
data/lib/m.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  ### M, your metal test runner
2
2
  # Maybe this gem should have a longer name? Metal?
3
- require_relative 'm/version'
4
- require_relative 'm/frameworks'
5
- require_relative 'm/runner'
3
+ require_relative "m/version"
4
+ require_relative "m/frameworks"
5
+ require_relative "m/runner"
6
6
 
7
7
  module M
8
8
  # Accept arguments coming from bin/m and run tests, then bail out immediately.
9
- def self.run(argv)
9
+ def self.run argv
10
10
  # sync output since we're going to exit hard and fast
11
11
  $stdout.sync = true
12
12
  $stderr.sync = true
data/m.gemspec CHANGED
@@ -1,26 +1,25 @@
1
- require './lib/m'
1
+ require "./lib/m"
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.authors = ["Nick Quaranto"]
5
- gem.email = ["nick@quaran.to"]
6
- gem.homepage = "https://github.com/qrush/m"
4
+ gem.authors = ["Nick Quaranto"]
5
+ gem.email = ["nick@quaran.to"]
6
+ gem.homepage = "https://github.com/qrush/m"
7
+ gem.license = "MIT"
7
8
 
8
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
9
- gem.files = `git ls-files`.split("\n")
10
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
11
- gem.name = "m"
9
+ gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
10
+ gem.files = `git ls-files`.split "\n"
11
+ gem.name = "m"
12
12
  gem.require_paths = ["lib"]
13
- gem.version = M::VERSION
13
+ gem.version = M::VERSION
14
14
 
15
15
  gem.add_runtime_dependency "method_source", ">= 0.6.7"
16
16
  gem.add_runtime_dependency "rake", ">= 0.9.2.2"
17
17
 
18
18
  gem.add_development_dependency "activesupport"
19
- gem.add_development_dependency "rdiscount" unless defined? JRUBY_VERSION
20
- gem.add_development_dependency "rocco" unless defined? JRUBY_VERSION
21
- gem.add_development_dependency "appraisal"
19
+ gem.add_development_dependency "standard"
22
20
 
23
- gem.required_ruby_version = ">= 1.9"
21
+ gem.required_ruby_version = ">= 2.7"
24
22
 
25
- gem.summary = gem.description = %q{Run test/unit tests by line number. Metal!}
23
+ gem.summary = gem.description = "Run test/unit tests by line number. Metal!"
24
+ gem.metadata["rubygems_mfa_required"] = "true"
26
25
  end
data/test/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "rake/testtask"
2
2
 
3
3
  Rake::TestTask.new do |t|
4
- t.libs << '.'
5
- t.pattern = 'examples/*_test.rb'
4
+ t.libs << "."
5
+ t.pattern = "examples/*_test.rb"
6
6
  end
@@ -1,53 +1,53 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class ActiveSupportTest < MTest
4
4
  def test_run_simple_test_by_line_number
5
- output = m('examples/active_support_example_test.rb:12')
5
+ output = m "examples/active_support_example_test.rb:9"
6
6
  assert_output(/1 (runs|tests), 1 assertions/, output)
7
7
  end
8
8
 
9
9
  def test_runs_entire_test_without_line_number
10
- output = m('examples/active_support_example_test.rb')
10
+ output = m "examples/active_support_example_test.rb"
11
11
  assert_output(/4 (runs|tests)/, output)
12
12
  end
13
13
 
14
14
  def test_run_inside_of_test
15
- output = m('examples/active_support_example_test.rb:13')
15
+ output = m "examples/active_support_example_test.rb:10"
16
16
  assert_output(/1 (runs|tests), 1 assertions/, output)
17
17
  end
18
18
 
19
19
  def test_run_on_end_of_test
20
- output = m('examples/active_support_example_test.rb:14')
20
+ output = m "examples/active_support_example_test.rb:11"
21
21
  assert_output(/1 (runs|tests), 1 assertions/, output)
22
22
  end
23
23
 
24
24
  def test_run_inside_big_test
25
- output = m('examples/active_support_example_test.rb:18')
25
+ output = m "examples/active_support_example_test.rb:15"
26
26
  assert_output(/1 (runs|tests), 3 assertions/, output)
27
27
  end
28
28
 
29
29
  def test_run_on_blank_line_orders_tests_by_line_number
30
- output = m('examples/active_support_example_test.rb:2')
30
+ output = m "examples/active_support_example_test.rb:8"
31
31
 
32
32
  assert !$?.success?
33
- expected = <<-EOF
34
- No tests found on line 2. Valid tests to run:
35
-
36
- test_normal: m examples/active_support_example_test.rb:8
37
- test_carrot: m examples/active_support_example_test.rb:12
38
- test_daikon: m examples/active_support_example_test.rb:16
39
- test_eggplant_fig: m examples/active_support_example_test.rb:22
40
- EOF
33
+ expected = <<~OUTPUT
34
+ No tests found on line 8. Valid tests to run:
35
+
36
+ test_normal: m examples/active_support_example_test.rb:5
37
+ test_carrot: m examples/active_support_example_test.rb:9
38
+ test_daikon: m examples/active_support_example_test.rb:13
39
+ test_eggplant_fig: m examples/active_support_example_test.rb:19
40
+ OUTPUT
41
41
  assert_equal expected.strip, output
42
42
  end
43
43
 
44
44
  def test_run_on_test_with_spaces
45
- output = m('examples/active_support_example_test.rb:22')
45
+ output = m "examples/active_support_example_test.rb:19"
46
46
  assert_output(/1 (runs|tests), 1 assertions/, output)
47
47
  end
48
48
 
49
49
  def test_run_on_test_with_unescaped_regular_express_characters
50
- output = m('examples/active_support_unescaped_example_test.rb:8')
50
+ output = m "examples/active_support_unescaped_example_test.rb:5"
51
51
  assert_output(/1 (runs|tests), 1 assertions/, output)
52
52
  end
53
53
  end
data/test/allocations.rb CHANGED
@@ -1,23 +1,21 @@
1
- $LOAD_PATH.unshift 'lib'
2
- require 'm'
3
- require 'allocation_stats'
1
+ $LOAD_PATH.unshift "lib"
2
+ require "m"
3
+ require "allocation_stats"
4
4
 
5
- def benchmark_allocations(burn: 1)
6
- stats = AllocationStats.new(burn: burn).trace do
7
- yield
8
- end
5
+ def benchmark_allocations burn: 1, &block
6
+ stats = AllocationStats.new(burn: burn).trace(&block)
9
7
 
10
- columns = if ENV['DETAIL']
11
- [:sourcefile, :sourceline, :class_plus]
12
- else
13
- [:class_plus]
14
- end
8
+ columns = if ENV["DETAIL"]
9
+ [:sourcefile, :sourceline, :class_plus]
10
+ else
11
+ [:class_plus]
12
+ end
15
13
 
16
14
  puts stats.allocations(alias_paths: true).group_by(*columns).sort_by_size.to_text
17
15
  end
18
16
 
19
17
  benchmark_allocations do
20
18
  10.times do
21
- M::Runner.new(['test/examples/minitest_5_example_test.rb:19']).run
19
+ M::Runner.new(["test/examples/minitest_5_example_test.rb:19"]).run
22
20
  end
23
21
  end
data/test/bench.rb CHANGED
@@ -1,35 +1,35 @@
1
- require 'benchmark/ips'
1
+ require "benchmark/ips"
2
2
 
3
3
  Benchmark.ips do |bench|
4
4
  bench.report("running m on a file that doesn't exist") do
5
- `ruby -Ilib ./bin/m failwhale 2>/dev/null`
5
+ `bundle exec ruby -Ilib ./bin/m failwhale 2>/dev/null`
6
6
  end
7
7
 
8
8
  bench.report("running m on an empty file") do
9
- `ruby -Ilib ./bin/m test/examples/empty_example_test.rb 2>/dev/null`
9
+ `bundle exec ruby -Ilib ./bin/m test/examples/empty_example_test.rb 2>/dev/null`
10
10
  end
11
11
 
12
12
  bench.report("running m on an entire file with minitest4") do
13
- `appraisal minitest4 ruby -Ilib ./bin/m test/examples/minitest_4_example_test.rb 2>/dev/null`
13
+ `BUNDLE_GEMFILE=gemfiles/minitest4.gemfile bundle exec ruby -Ilib ./bin/m test/examples/minitest_4_example_test.rb 2>/dev/null`
14
14
  end
15
15
 
16
16
  bench.report("running m on an entire file with minitest5") do
17
- `appraisal minitest5 ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb 2>/dev/null`
17
+ `BUNDLE_GEMFILE=gemfiles/minitest5.gemfile bundle exec ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb 2>/dev/null`
18
18
  end
19
19
 
20
20
  bench.report("running m on an entire file with test-unit gem") do
21
- `appraisal test_unit_gem ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb 2>/dev/null`
21
+ `BUNDLE_GEMFILE=gemfiles/test_unit_gem.gemfile bundle exec ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb 2>/dev/null`
22
22
  end
23
23
 
24
24
  bench.report("running m on a specific test with minitest4") do
25
- `appraisal minitest4 ruby -Ilib ./bin/m test/examples/minitest_4_example_test.rb:19 2>/dev/null`
25
+ `BUNDLE_GEMFILE=gemfiles/minitest4.gemfile bundle exec ruby -Ilib ./bin/m test/examples/minitest_4_example_test.rb:19 2>/dev/null`
26
26
  end
27
27
 
28
28
  bench.report("running m on a specific test with minitest5") do
29
- `appraisal minitest5 ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb:19 2>/dev/null`
29
+ `BUNDLE_GEMFILE=gemfiles/minitest5.gemfile bundle exec ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb:19 2>/dev/null`
30
30
  end
31
31
 
32
32
  bench.report("running m on a specific test with test-unit gem") do
33
- `appraisal test_unit_gem ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb:15 2>/dev/null`
33
+ `BUNDLE_GEMFILE=gemfiles/test_unit_gem.gemfile bundle exec ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb:15 2>/dev/null`
34
34
  end
35
35
  end
data/test/empty_test.rb CHANGED
@@ -1,8 +1,8 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class EmptyTest < MTest
4
4
  def test_run_simple_test_by_line_number
5
- output = m('examples/empty_example_test.rb')
5
+ output = m "examples/empty_example_test.rb"
6
6
  assert !$?.success?
7
7
  assert_match(/There were no tests found./, output)
8
8
  end
@@ -1,13 +1,13 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class EverythingTest < MTest
4
4
  def test_runs_entire_test_suite_with_no_arguments
5
- output = m('')
5
+ output = m ""
6
6
  assert_output(/12 (runs|tests)/, output)
7
7
  end
8
8
 
9
9
  def test_missing_file_gives_a_decent_error_message
10
- output = m('examples/thisdoesnexist_test.rb')
10
+ output = m "examples/thisdoesnexist_test.rb"
11
11
  assert !$?.success?
12
12
  assert_match(/Failed loading test file/, output)
13
13
  if defined? JRUBY_VERSION
@@ -18,20 +18,20 @@ class EverythingTest < MTest
18
18
  end
19
19
 
20
20
  def test_running_tests_within_a_subdirectory
21
- output = m('examples/subdir')
21
+ output = m "examples/subdir"
22
22
  assert_output(/3 (runs|tests)/, output)
23
23
 
24
- output = m('examples')
24
+ output = m "examples"
25
25
  assert_output(/12 (runs|tests)/, output)
26
26
  end
27
27
 
28
28
  def test_running_tests_with_failures_within_a_subdirectory
29
- output = m('examples/subdir_with_failures')
29
+ output = m "examples/subdir_with_failures"
30
30
  assert_output_for_failed_execution(/1 (runs|tests), 1 assertions, 1 failures/, output)
31
31
  end
32
32
 
33
33
  def test_blank_file_is_quieter
34
- output = m('bananas')
34
+ output = m "bananas"
35
35
  assert(/Valid tests to run/ !~ output)
36
36
  end
37
37
  end
@@ -1,10 +1,7 @@
1
- require 'active_support'
2
- require 'active_support/test_case'
1
+ require "active_support"
2
+ require "active_support/test_case"
3
3
 
4
4
  class ActiveSupportExampleTest < ActiveSupport::TestCase
5
- setup do
6
- end
7
-
8
5
  def test_normal
9
6
  assert_equal 1, 1
10
7
  end
@@ -1,10 +1,7 @@
1
- require 'active_support'
2
- require 'active_support/test_case'
1
+ require "active_support"
2
+ require "active_support/test_case"
3
3
 
4
4
  class ActiveSupportExampleTest < ActiveSupport::TestCase
5
- setup do
6
- end
7
-
8
5
  test "#assert_equal compares to objects (and ensures they are equal)" do
9
6
  assert_equal 1, 1
10
7
  end
@@ -1,4 +1,4 @@
1
- require_relative '../test_helper'
1
+ require_relative "../test_helper"
2
2
 
3
3
  class EmptyExampleTest < MTest
4
4
  end
@@ -1,4 +1,4 @@
1
- require 'minitest/unit'
1
+ require "minitest/unit"
2
2
 
3
3
  if M::Frameworks.minitest4?
4
4
  class Meme
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require "minitest/autorun"
2
2
 
3
3
  if M::Frameworks.minitest5?
4
4
  class Meme
@@ -1,4 +1,4 @@
1
- require 'minitest/unit'
1
+ require "minitest/unit"
2
2
 
3
3
  class Meme
4
4
  def i_can_has_cheezburger?
@@ -32,5 +32,5 @@ class TestMeme < Test
32
32
  assert_equal "OHAI!", @meme.i_can_has_cheezburger?
33
33
  end
34
34
 
35
- Minitest.after_run { p "ran after run block" } if Minitest.respond_to?(:after_run)
35
+ Minitest.after_run { p "ran after run block" } if Minitest.respond_to? :after_run
36
36
  end
@@ -1,8 +1,8 @@
1
- require 'active_support'
2
- require 'active_support/test_case'
1
+ require "active_support"
2
+ require "active_support/test_case"
3
3
 
4
4
  class MultipleExampleTest < ActiveSupport::TestCase
5
- %w(grape habanero iceplant).each do |fruit|
5
+ ["grape", "habanero", "iceplant"].each do |fruit|
6
6
  test "#{fruit} is a fruit" do
7
7
  assert_equal 1, 1
8
8
  end
@@ -1,4 +1,4 @@
1
- require_relative '../../test_helper'
1
+ require_relative "../../test_helper"
2
2
 
3
3
  class ATest < MTest
4
4
  def test_a
@@ -1,4 +1,4 @@
1
- require_relative '../../../test_helper'
1
+ require_relative "../../../test_helper"
2
2
 
3
3
  class DTest < MTest
4
4
  def test_d
@@ -1,4 +1,4 @@
1
- require_relative '../../../../test_helper'
1
+ require_relative "../../../../test_helper"
2
2
 
3
3
  class ETest < MTest
4
4
  def test_e
@@ -1,4 +1,4 @@
1
- require_relative '../../test_helper'
1
+ require_relative "../../test_helper"
2
2
 
3
3
  class BTest < MTest
4
4
  def test_b
@@ -1,4 +1,4 @@
1
- require_relative '../../test_helper'
1
+ require_relative "../../test_helper"
2
2
 
3
3
  class CTest < MTest
4
4
  def test_c
@@ -1,4 +1,4 @@
1
- require_relative '../../test_helper'
1
+ require_relative "../../test_helper"
2
2
 
3
3
  class ATest < MTest
4
4
  def test_a
@@ -1,5 +1,5 @@
1
- require_relative '../test_helper'
2
- try_loading('test-unit')
1
+ require_relative "../test_helper"
2
+ try_loading "test-unit"
3
3
 
4
4
  if M::Frameworks.test_unit?
5
5
  class TestUnitExampleTest < Test::Unit::TestCase
@@ -2,32 +2,32 @@ require "test_helper"
2
2
 
3
3
  class ExitCodesTest < MTest
4
4
  def test_failing_test_returns_1
5
- m("examples/subdir_with_failures/a_test")
5
+ m "examples/subdir_with_failures/a_test"
6
6
  refute $?.success?, "expected exit code to be 1 but it was #{$?.exitstatus}"
7
7
  end
8
8
 
9
9
  def test_test_with_error_returns_1
10
- m("../lib/error_tests/error_test")
10
+ m "../lib/error_tests/error_test"
11
11
  refute $?.success?, "expected exit code to be 1 but it was #{$?.exitstatus}"
12
12
  end
13
13
 
14
14
  def test_dir_with_failure_returns_1
15
- m("examples/subdir_with_failures")
15
+ m "examples/subdir_with_failures"
16
16
  refute $?.success?, "expected exit code to be 1 but it was #{$?.exitstatus}"
17
17
  end
18
18
 
19
19
  def test_dir_with_error_returns_1
20
- m("../lib/error_tests")
20
+ m "../lib/error_tests"
21
21
  refute $?.success?, "expected exit code to be 1 but it was #{$?.exitstatus}"
22
22
  end
23
23
 
24
24
  def test_without_errors_or_failures_returns_0
25
- m("examples/subdir/a_test")
25
+ m "examples/subdir/a_test"
26
26
  assert $?.success?, "expected exit code to be 0 but it was #{$?.exitstatus}"
27
27
  end
28
28
 
29
29
  def test_dir_without_errors_or_failures_returns_0
30
- m("examples/subdir")
30
+ m "examples/subdir"
31
31
  assert $?.success?, "expected exit code to be 0 but it was #{$?.exitstatus}"
32
32
  end
33
33
  end
@@ -1,34 +1,34 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  if M::Frameworks.minitest4?
4
4
  class Minitest4Test < MTest
5
5
  def test_run_simple_test_by_line_number
6
- output = m('examples/minitest_4_example_test.rb:19')
6
+ output = m "examples/minitest_4_example_test.rb:19"
7
7
  assert_output(/1 tests, 1 assertions/, output)
8
8
  end
9
9
 
10
10
  def test_runs_entire_test_without_line_number
11
- output = m('examples/minitest_4_example_test.rb')
11
+ output = m "examples/minitest_4_example_test.rb"
12
12
  assert_output(/3 tests/, output)
13
13
  end
14
14
 
15
15
  def test_run_inside_of_test
16
- output = m('examples/minitest_4_example_test.rb:20')
16
+ output = m "examples/minitest_4_example_test.rb:20"
17
17
  assert_output(/1 tests, 1 assertions/, output)
18
18
  end
19
19
 
20
20
  def test_run_on_end_of_test
21
- output = m('examples/minitest_4_example_test.rb:21')
21
+ output = m "examples/minitest_4_example_test.rb:21"
22
22
  assert_output(/1 tests, 1 assertions/, output)
23
23
  end
24
24
 
25
25
  def test_run_inside_big_test
26
- output = m('examples/minitest_4_example_test.rb:26')
26
+ output = m "examples/minitest_4_example_test.rb:26"
27
27
  assert_output(/1 tests, 6 assertions/, output)
28
28
  end
29
29
 
30
30
  def test_run_on_blank_line
31
- output = m('examples/minitest_4_example_test.rb:2')
31
+ output = m "examples/minitest_4_example_test.rb:2"
32
32
 
33
33
  assert !$?.success?
34
34
  assert_match(/No tests found on line 2. Valid tests to run:/, output)
@@ -1,33 +1,33 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
  if M::Frameworks.minitest5?
3
3
  class Minitest5Test < MTest
4
4
  def test_run_simple_test_by_line_number
5
- output = m('examples/minitest_5_example_test.rb:19')
5
+ output = m "examples/minitest_5_example_test.rb:19"
6
6
  assert_output(/1 runs, 1 assertions/, output)
7
7
  end
8
8
 
9
9
  def test_runs_entire_test_without_line_number
10
- output = m('examples/minitest_5_example_test.rb')
10
+ output = m "examples/minitest_5_example_test.rb"
11
11
  assert_output(/3 runs/, output)
12
12
  end
13
13
 
14
14
  def test_run_inside_of_test
15
- output = m('examples/minitest_5_example_test.rb:20')
15
+ output = m "examples/minitest_5_example_test.rb:20"
16
16
  assert_output(/1 runs, 1 assertions/, output)
17
17
  end
18
18
 
19
19
  def test_run_on_end_of_test
20
- output = m('examples/minitest_5_example_test.rb:21')
20
+ output = m "examples/minitest_5_example_test.rb:21"
21
21
  assert_output(/1 runs, 1 assertions/, output)
22
22
  end
23
23
 
24
24
  def test_run_inside_big_test
25
- output = m('examples/minitest_5_example_test.rb:26')
25
+ output = m "examples/minitest_5_example_test.rb:26"
26
26
  assert_output(/1 runs, 6 assertions/, output)
27
27
  end
28
28
 
29
29
  def test_run_on_blank_line
30
- output = m('examples/minitest_5_example_test.rb:3')
30
+ output = m "examples/minitest_5_example_test.rb:3"
31
31
 
32
32
  assert !$?.success?
33
33
  assert_match(/No tests found on line 3. Valid tests to run:/, output)
@@ -36,7 +36,7 @@ if M::Frameworks.minitest5?
36
36
  end
37
37
 
38
38
  def test_run_with_after_run_block
39
- output = m('examples/minitest_5_example_test.rb')
39
+ output = m "examples/minitest_5_example_test.rb"
40
40
 
41
41
  assert_output(/ran after run block/, output)
42
42
  end