Sha256: f772cc301ddfae73c6fd26bcaa16fa4f0e5931dcec8aa19b19891ea24255274d

Contents?: true

Size: 1.2 KB

Versions: 149

Compression:

Stored size: 1.2 KB

Contents

require_relative "../../test_helper"

module MinitestReportersTest
  class ExtensibleBacktraceFilterTest < TestCase
    def setup
      @default_filter = Minitest::ExtensibleBacktraceFilter.default_filter
      @filter = Minitest::ExtensibleBacktraceFilter.new
      @backtrace = ["foo", "bar", "baz"]
    end

    def test_adding_filters
      @filter.add_filter(/foo/)
      assert @filter.filters?("foo")
      refute @filter.filters?("baz")
    end

    def test_filter_backtrace_when_first_line_is_filtered
      @filter.add_filter(/foo/)
      assert_equal ["bar", "baz"], @filter.filter(@backtrace)
    end

    def test_filter_backtrace_when_middle_line_is_filtered
      @filter.add_filter(/bar/)
      assert_equal ["foo"], @filter.filter(@backtrace)
    end

    def test_filter_backtrace_when_all_lines_are_filtered
      @filter.add_filter(/./)
      assert_equal ["foo", "bar", "baz"], @filter.filter(@backtrace)
    end

    def test_default_filter
      assert @default_filter.filters?("lib/minitest")
      assert @default_filter.filters?("lib/minitest/reporters")
      refute @default_filter.filters?("lib/my_gem")
    end

    def test_nil_backtrace
      assert_equal [], @filter.filter(nil)
    end
  end
end

Version data entries

149 entries across 107 versions & 11 rubygems

Version Path
paynow_sdk-0.2.0 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.9 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.8/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.8/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.9 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.8/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.9 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
josufst_palindrome-0.2.0 vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/extensible_backtrace_filter_test.rb
josufst_palindrome-0.2.0 vendor/cache/ruby/2.6.0/gems/minitest-reporters-1.2.0/test/unit/minitest/extensible_backtrace_filter_test.rb
josufst_palindrome-0.1.1 vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/extensible_backtrace_filter_test.rb
josufst_palindrome-0.1.1 vendor/cache/ruby/2.6.0/gems/minitest-reporters-1.2.0/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.8 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.7 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.6/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.7 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.6 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/minitest-reporters-1.4.2/test/unit/minitest/extensible_backtrace_filter_test.rb