class TestMinitestUnitTestCase
Constants
- RUBY18
do not call parallelize_me! - teardown accesses @tc._assertions which is not threadsafe. Nearly every method in here is an assertion test so it isn’t worth splitting it out further.
Public Class Methods
test_order()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 851 def self.test_order; :random; end
Public Instance Methods
non_verbose() { || ... }
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 838 def non_verbose orig_verbose = $VERBOSE $VERBOSE = false yield ensure $VERBOSE = orig_verbose end
setup()
click to toggle source
Calls superclass method
Minitest::Test::LifecycleHooks#setup
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 823 def setup super Minitest::Test.reset @tc = Minitest::Test.new "fake tc" @zomg = "zomg ponies!" @assertion_count = 1 end
teardown()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 833 def teardown assert_equal(@assertion_count, @tc.assertions, "expected #{@assertion_count} assertions to be fired during the test, not #{@tc.assertions}") if @tc.passed? end
test_autorun_does_not_affect_fork_exit_status()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 905 def test_autorun_does_not_affect_fork_exit_status @assertion_count = 0 skip "windows doesn't have skip" unless Process.respond_to?(:fork) Process.waitpid(fork { exit 42 }) assert_equal 42, $?.exitstatus end
test_autorun_does_not_affect_fork_success_status()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 898 def test_autorun_does_not_affect_fork_success_status @assertion_count = 0 skip "windows doesn't have skip" unless Process.respond_to?(:fork) Process.waitpid(fork {}) assert_equal true, $?.success? end
test_i_suck_and_my_tests_are_order_dependent_bang_does_not_warn()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 886 def test_i_suck_and_my_tests_are_order_dependent_bang_does_not_warn @assertion_count = 0 shitty_test_case = Class.new FakeNamedTest def shitty_test_case.test_order; :lol end assert_silent do shitty_test_case.i_suck_and_my_tests_are_order_dependent! end end
test_i_suck_and_my_tests_are_order_dependent_bang_sets_test_order_alpha()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 876 def test_i_suck_and_my_tests_are_order_dependent_bang_sets_test_order_alpha @assertion_count = 0 shitty_test_case = Class.new FakeNamedTest shitty_test_case.i_suck_and_my_tests_are_order_dependent! assert_equal :alpha, shitty_test_case.test_order end
test_runnable_methods_random()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 847 def test_runnable_methods_random @assertion_count = 0 sample_test_case = Class.new FakeNamedTest do def self.test_order; :random; end def test_test1; assert "does not matter" end def test_test2; assert "does not matter" end def test_test3; assert "does not matter" end end srand 42 expected = %w[test_test2 test_test1 test_test3] assert_equal expected, sample_test_case.runnable_methods end
test_runnable_methods_sorted()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 862 def test_runnable_methods_sorted @assertion_count = 0 sample_test_case = Class.new FakeNamedTest do def self.test_order; :sorted end def test_test3; assert "does not matter" end def test_test2; assert "does not matter" end def test_test1; assert "does not matter" end end expected = %w[test_test1 test_test2 test_test3] assert_equal expected, sample_test_case.runnable_methods end
test_test1()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 852 def test_test1; assert "does not matter" end
test_test2()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 853 def test_test2; assert "does not matter" end
test_test3()
click to toggle source
# File minitest-5.13.0/test/minitest/test_minitest_test.rb, line 854 def test_test3; assert "does not matter" end