Class: TestMinitestUnitOrder
- Inherits:
-
MetaMetaMetaTestCase
- Object
- Minitest::Runnable
- Minitest::Test
- MetaMetaMetaTestCase
- TestMinitestUnitOrder
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test.rb
Constant Summary
Constants inherited from Minitest::Test
Minitest::Test::PASSTHROUGH_EXCEPTIONS, Minitest::Test::SETUP_METHODS, Minitest::Test::TEARDOWN_METHODS
Constants included from Minitest::Assertions
Minitest::Assertions::E, Minitest::Assertions::UNDEFINED
Constants inherited from Minitest::Runnable
Instance Attribute Summary
Attributes inherited from MetaMetaMetaTestCase
Attributes inherited from Minitest::Runnable
Instance Method Summary collapse
- #test_after_teardown ⇒ Object
- #test_all_teardowns_are_guaranteed_to_run ⇒ Object
-
#test_before_setup ⇒ Object
do not parallelize this suite…
- #test_setup_and_teardown_survive_inheritance ⇒ Object
Methods inherited from MetaMetaMetaTestCase
#assert_report, #first_reporter, #normalize_output, #restore_env, #run_tu_with_fresh_reporter, #setup, #with_stderr
Methods inherited from Minitest::Test
#capture_exceptions, #class_name, #clean, i_suck_and_my_tests_are_order_dependent!, make_my_diffs_pretty!, #neuter_exception, #new_exception, parallelize_me!, #run, runnable_methods, #sanitize_exception, test_order, #with_empty_backtrace_filter, #with_info_handler
Methods included from Minitest::Guard
#jruby?, #maglev?, #mri?, #osx?, #rubinius?, #windows?
Methods included from Minitest::Test::LifecycleHooks
#after_setup, #after_teardown, #before_setup, #before_teardown, #setup, #teardown
Methods included from Minitest::Reportable
#class_name, #error?, #location, #passed?, #result_code, #skipped?
Methods included from Minitest::Assertions
#_synchronize, #assert, #assert_empty, #assert_equal, #assert_in_delta, #assert_in_epsilon, #assert_includes, #assert_instance_of, #assert_kind_of, #assert_match, #assert_mock, #assert_nil, #assert_operator, #assert_output, #assert_path_exists, #assert_predicate, #assert_raises, #assert_respond_to, #assert_same, #assert_send, #assert_silent, #assert_throws, #capture_io, #capture_subprocess_io, #diff, diff, diff=, #exception_details, #fail_after, #flunk, #message, #mu_pp, #mu_pp_for_diff, #pass, #refute, #refute_empty, #refute_equal, #refute_in_delta, #refute_in_epsilon, #refute_includes, #refute_instance_of, #refute_kind_of, #refute_match, #refute_nil, #refute_operator, #refute_path_exists, #refute_predicate, #refute_respond_to, #refute_same, #skip, #skip_until, #skipped?, #things_to_diff
Methods inherited from Minitest::Runnable
#failure, inherited, #initialize, #marshal_dump, #marshal_load, methods_matching, #name, #name=, on_signal, #passed?, reset, #result_code, run, #run, run_one_method, runnable_methods, runnables, #skipped?, #time_it, #whatever, with_info_handler
Constructor Details
This class inherits a constructor from Minitest::Runnable
Instance Method Details
#test_after_teardown ⇒ Object
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test.rb', line 707 def test_after_teardown call_order = [] @tu = Class.new FakeNamedTest do define_method :teardown do super() call_order << :teardown end define_method :after_teardown do call_order << :after_teardown end def test_omg; assert true; end end run_tu_with_fresh_reporter expected = [:teardown, :after_teardown] assert_equal expected, call_order end |
#test_all_teardowns_are_guaranteed_to_run ⇒ Object
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test.rb', line 729 def test_all_teardowns_are_guaranteed_to_run call_order = [] @tu = Class.new FakeNamedTest do define_method :after_teardown do super() call_order << :after_teardown raise end define_method :teardown do super() call_order << :teardown raise end define_method :before_teardown do super() call_order << :before_teardown raise end def test_omg; assert true; end end run_tu_with_fresh_reporter expected = [:before_teardown, :teardown, :after_teardown] assert_equal expected, call_order end |
#test_before_setup ⇒ Object
do not parallelize this suite… it just can’t handle it.
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test.rb', line 685 def test_before_setup call_order = [] @tu = Class.new FakeNamedTest do define_method :setup do super() call_order << :setup end define_method :before_setup do call_order << :before_setup end def test_omg; assert true; end end run_tu_with_fresh_reporter expected = [:before_setup, :setup] assert_equal expected, call_order end |
#test_setup_and_teardown_survive_inheritance ⇒ Object
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test.rb', line 760 def test_setup_and_teardown_survive_inheritance call_order = [] @tu = Class.new FakeNamedTest do define_method :setup do call_order << :setup_method end define_method :teardown do call_order << :teardown_method end define_method :test_something do call_order << :test end end run_tu_with_fresh_reporter @tu = Class.new @tu run_tu_with_fresh_reporter # Once for the parent class, once for the child expected = [:setup_method, :test, :teardown_method] * 2 assert_equal expected, call_order end |