Sha256: 4a3f1dc5c6e16cb045f802d1b6808d20db29bbb389667eaa7bd5eb969e86575e

Contents?: true

Size: 1.77 KB

Versions: 5

Compression:

Stored size: 1.77 KB

Contents

require_relative "../../test_helper"

module MinitestReportersTest
  class ProgressReporterTest < TestCase
    def test_all_failures_are_displayed
      fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
      test_filename = File.join(fixtures_directory, 'progress_test.rb')
      output = `ruby #{test_filename} 2>&1`
      assert_match 'ERROR["test_error"', output, 'Errors should be displayed'
      assert_match 'FAIL["test_failure"', output, 'Failures should be displayed'
      assert_match 'SKIP["test_skip', output, 'Skipped tests should be displayed'
    end
    def test_skipped_tests_are_not_displayed
      fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
      test_filename = File.join(fixtures_directory, 'progress_detailed_skip_test.rb')
      output = `ruby #{test_filename} 2>&1`
      assert_match 'ERROR["test_error"', output, 'Errors should be displayed'
      assert_match 'FAIL["test_failure"', output, 'Failures should be displayed'
      refute_match 'SKIP["test_skip', output, 'Skipped tests should not be displayed'
    end
    def test_progress_works_with_filter_and_specs
      fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
      test_filename = File.join(fixtures_directory, 'spec_test.rb')
      output = `ruby #{test_filename} -n /length/ 2>&1`
      refute_match '0 out of 0', output, 'Progress should not puts a warning'
    end
    def test_progress_works_with_strict_filter
      fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
      test_filename = File.join(fixtures_directory, 'spec_test.rb')
      output = `ruby #{test_filename} -n /^test_0001_works$/ 2>&1`
      refute_match '0 out of 0', output, 'Progress should not puts a warning'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
minitest-reporters-1.3.2 test/integration/reporters/progress_reporter_test.rb
minitest-reporters-1.3.2.beta2 test/integration/reporters/progress_reporter_test.rb
minitest-reporters-1.3.2.beta1 test/integration/reporters/progress_reporter_test.rb
minitest-reporters-1.3.1 test/integration/reporters/progress_reporter_test.rb
minitest-reporters-1.3.1.beta1 test/integration/reporters/progress_reporter_test.rb