Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.3.0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (30 sloc) 1.162 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
require 'test_helper'

class MinitestTest < MTest
  def test_run_simple_test_by_line_number
    output = m('examples/minitest_example_test.rb:19')
    assert_output /1 tests, 1 assertions/, output
  end

  def test_runs_entire_test_without_line_number
    output = m('examples/minitest_example_test.rb')
    assert_output /2 tests/, output
  end

  def test_run_inside_of_test
    output = m('examples/minitest_example_test.rb:20')
    assert_output /1 tests, 1 assertions/, output
  end

  def test_run_on_end_of_test
    output = m('examples/minitest_example_test.rb:21')
    assert_output /1 tests, 1 assertions/, output
  end

  def test_run_inside_big_test
    output = m('examples/minitest_example_test.rb:25')
    assert_output /1 tests, 6 assertions/, output
  end

  def test_run_on_blank_line
    output = m('examples/minitest_example_test.rb:2')

    assert !$?.success?
    assert_match /No tests found on line 2. Valid tests to run:/, output
    assert_match %r{ test_that_kitty_can_eat: m examples/minitest_example_test\.rb:19}, output
    assert_match %r{test_that_it_will_not_blend: m examples/minitest_example_test\.rb:23}, output
  end
end

Something went wrong with that request. Please try again.