Sha256: a1d866ddf353a66b98fb2a64ab2b2da5f8c3c0aa75bc35ebe9d834caa10e7071

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'

class EverythingTest < MTest
  def test_runs_entire_test_suite_with_no_arguments
    output = m('')
    assert_output(/12 (runs|tests)/, output)
  end

  def test_missing_file_gives_a_decent_error_message
    output = m('examples/thisdoesnexist_test.rb')
    assert !$?.success?
    assert_match(/Failed loading test file/, output)
    if defined? JRUBY_VERSION
      assert_match(/no such file to load/, output)
    else
      assert_match(/cannot load such file/, output)
    end
  end

  def test_running_tests_within_a_subdirectory
    output = m('examples/subdir')
    assert_output(/3 (runs|tests)/, output)

    output = m('examples')
    assert_output(/12 (runs|tests)/, output)
  end

  def test_running_tests_with_failures_within_a_subdirectory
    output = m('examples/subdir_with_failures')
    assert_output_for_failed_execution(/1 (runs|tests), 1 assertions, 1 failures/, output)
  end

  def test_blank_file_is_quieter
    output = m('bananas')
    assert(/Valid tests to run/ !~ output)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
m-1.6.1 test/everything_test.rb
m-1.6.0 test/everything_test.rb