mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Let testunit use omit or pend instead of skip
This commit is contained in:
		
							parent
							
								
									2ae9da23c5
								
							
						
					
					
						commit
						56b45e8c8e
					
				
				
				Notes:
				
					git
				
				2022-01-16 21:35:41 +09:00 
				
			
			
			
		
		
					 4 changed files with 28 additions and 10 deletions
				
			
		|  | @ -4,7 +4,11 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" | |||
| require 'test/unit' | ||||
| 
 | ||||
| class TestForTestHideSkip < Test::Unit::TestCase | ||||
|   def test_skip | ||||
|     skip "do nothing" | ||||
|   def test_omit | ||||
|     omit "do nothing" | ||||
|   end | ||||
| 
 | ||||
|   def test_pend | ||||
|     pend "do nothing" | ||||
|   end | ||||
| end | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ require 'test/unit' | |||
| 
 | ||||
| class TestForTestHideSkip < Test::Unit::TestCase | ||||
|   def test_c | ||||
|     skip "do nothing" | ||||
|     omit "do nothing" | ||||
|   end | ||||
| 
 | ||||
|   def test_b | ||||
|  |  | |||
|  | @ -4,10 +4,10 @@ require 'test/unit' | |||
| class TestHideSkip < Test::Unit::TestCase | ||||
|   def test_hideskip | ||||
|     assert_not_match(/^ *1\) Skipped/, hideskip) | ||||
|     assert_match(/^ *1\) Skipped/, hideskip("--show-skip")) | ||||
|     assert_match(/^ *1\) Skipped.*^ *2\) Skipped/m, hideskip("--show-skip")) | ||||
|     output = hideskip("--hide-skip") | ||||
|     output.gsub!(/Successful MJIT finish\n/, '') if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? | ||||
|     assert_match(/assertions\/s.\n+1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, output) | ||||
|     assert_match(/assertions\/s.\n+2 tests, 0 assertions, 0 failures, 0 errors, 2 skips/, output) | ||||
|   end | ||||
| 
 | ||||
|   private | ||||
|  |  | |||
|  | @ -171,7 +171,7 @@ class TestMiniTestUnit < MetaMetaMetaTestCase | |||
|   def test_passed_eh_teardown_skipped | ||||
|     test_class = Class.new Test::Unit::TestCase do | ||||
|       def teardown; assert true; end | ||||
|       def test_omg; skip "bork"; end | ||||
|       def test_omg; omit "bork"; end | ||||
|     end | ||||
| 
 | ||||
|     test = test_class.new :test_omg | ||||
|  | @ -896,7 +896,7 @@ class TestMiniTestUnitTestCase < Test::Unit::TestCase | |||
|         begin | ||||
|           raise "blah" | ||||
|         rescue | ||||
|           skip "skipped" | ||||
|           omit "skipped" | ||||
|         end | ||||
|       end | ||||
|     end | ||||
|  | @ -1323,11 +1323,19 @@ class TestMiniTestUnitTestCase < Test::Unit::TestCase | |||
|     end | ||||
|   end | ||||
| 
 | ||||
|   def test_skip | ||||
|   def test_omit | ||||
|     @assertion_count = 0 | ||||
| 
 | ||||
|     util_assert_triggered "haha!", Test::Unit::PendedError do | ||||
|       @tc.skip "haha!" | ||||
|       @tc.omit "haha!" | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   def test_pend | ||||
|     @assertion_count = 0 | ||||
| 
 | ||||
|     util_assert_triggered "haha!", Test::Unit::PendedError do | ||||
|       @tc.pend "haha!" | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  | @ -1467,7 +1475,13 @@ class TestMiniTestUnitRecording < MetaMetaMetaTestCase | |||
|   def test_record_skip | ||||
|     assert_run_record Test::Unit::PendedError do | ||||
|       def test_method | ||||
|         skip "not yet" | ||||
|         omit "not yet" | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     assert_run_record Test::Unit::PendedError do | ||||
|       def test_method | ||||
|         pend "not yet" | ||||
|       end | ||||
|     end | ||||
|   end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nobuyoshi Nakada
						Nobuyoshi Nakada