Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/m/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def suites

begin
# Fire up this Ruby file. Let's hope it actually has tests.
require "./#{testable.file}"
file = testable.file
file = "./#{testable.file}" unless file.start_with? "/"
require file
rescue LoadError => e
# Fail with a happier error message instead of spitting out a backtrace from this gem
warn "Failed loading test file:\n#{e.message}"
Expand Down
5 changes: 5 additions & 0 deletions test/active_support_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require "test_helper"

class ActiveSupportTest < MTest
def test_run_simple_test_by_line_number_with_absolute_path
output = m File.join(__dir__, "examples/active_support_example_test.rb:9")
assert_output(/1 (runs|tests), 1 assertions/, output)
end

def test_run_simple_test_by_line_number
output = m "examples/active_support_example_test.rb:9"
assert_output(/1 (runs|tests), 1 assertions/, output)
Expand Down
5 changes: 5 additions & 0 deletions test/minitest_4_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

if M::Frameworks.minitest4?
class Minitest4Test < MTest
def test_run_simple_test_by_line_number_with_absolute_path
output = m File.join(__dir__, "examples/minitest_4_example_test.rb:19")
assert_output(/1 tests, 1 assertions/, output)
end

def test_run_simple_test_by_line_number
output = m "examples/minitest_4_example_test.rb:19"
assert_output(/1 tests, 1 assertions/, output)
Expand Down
5 changes: 5 additions & 0 deletions test/minitest_5_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require "test_helper"
if M::Frameworks.minitest5?
class Minitest5Test < MTest
def test_run_simple_test_by_line_number_with_absolute_path
output = m File.join(__dir__, "examples/minitest_5_example_test.rb:19")
assert_output(/1 runs, 1 assertions/, output)
end

def test_run_simple_test_by_line_number
output = m "examples/minitest_5_example_test.rb:19"
assert_output(/1 runs, 1 assertions/, output)
Expand Down
5 changes: 5 additions & 0 deletions test/test_unit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

if M::Frameworks.test_unit?
class TestUnitTest < MTest
def test_run_simple_test_by_line_number_with_absolute_path
output = m File.join(__dir__, "examples/test_unit_example_test.rb:9")
assert_output(/1 tests, 1 assertions/, output)
end

def test_run_simple_test_by_line_number
output = m "examples/test_unit_example_test.rb:9"
assert_output(/1 tests, 1 assertions/, output)
Expand Down