mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	 47bd3ed9ce
			
		
	
	
		47bd3ed9ce
		
	
	
	
	
		
			
			#assert_block, and #flunk. * test/testunit/test_assertions.rb: ditto. * lib/test/unit/failure.rb: failures now show a better trace of where they occurred. * test/testunit/test_failure.rb: ditto (added). * lib/test/unit/testcase.rb: ditto. * test/testunit/test_testcase.rb: ditto. * lib/test/unit/util/backtracefilter.rb: added. * test/testunit/util/test_backtracefilter.rb: added. * lib/test/unit/error.rb: changed to use BacktraceFilter and improved output. * test/testunit/test_error.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			823 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			823 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # Author:: Nathaniel Talbott.
 | |
| # Copyright:: Copyright (c) 2003 Nathaniel Talbott. All rights reserved.
 | |
| # License:: Ruby license.
 | |
| 
 | |
| require 'test/unit'
 | |
| require 'test/unit/failure'
 | |
| 
 | |
| module Test::Unit
 | |
|   class TestFailure < TestCase
 | |
|     def test_display
 | |
|       f = Failure.new("name", [%q{location:1 in 'l'}], "message1\nmessage2")
 | |
|       assert_equal("name: message1", f.short_display)
 | |
|       assert_equal(<<EOM.strip, f.long_display)
 | |
| Failure:
 | |
| name [location:1]:
 | |
| message1
 | |
| message2
 | |
| EOM
 | |
| 
 | |
|       f = Failure.new("name", [%q{location1:2 in 'l1'}, 'location2:1', %q{location3:3 in 'l3'}], "message1\nmessage2")
 | |
|       assert_equal("name: message1", f.short_display)
 | |
|       assert_equal(<<EOM.strip, f.long_display)
 | |
| Failure:
 | |
| name
 | |
|     [location1:2 in 'l1'
 | |
|      location2:1
 | |
|      location3:3 in 'l3']:
 | |
| message1
 | |
| message2
 | |
| EOM
 | |
|     end
 | |
|   end
 | |
| end
 |