mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* Fix variable name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									d356ccc987
								
							
						
					
					
						commit
						5179e8a765
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		|  | @ -374,7 +374,7 @@ EOT | |||
|       } #` | ||||
| 
 | ||||
|       ## | ||||
|       # Passes if the block throws +expected_value+ | ||||
|       # Passes if the block throws +expected_object+ | ||||
|       # | ||||
|       # Example: | ||||
|       #   assert_throws :done do | ||||
|  | @ -382,22 +382,22 @@ EOT | |||
|       #   end | ||||
| 
 | ||||
|       public | ||||
|       def assert_throws(expected_value, message="", &proc) | ||||
|       def assert_throws(expected_object, message="", &proc) | ||||
|         _wrap_assertion do | ||||
|           assert_block("Should have passed a block to assert_throws."){block_given?} | ||||
|           caught = true | ||||
|           begin | ||||
|             catch(expected_value) do | ||||
|             catch(expected_object) do | ||||
|               proc.call | ||||
|               caught = false | ||||
|             end | ||||
|             full_message = build_message(message, "<?> should have been thrown.", expected_value) | ||||
|             full_message = build_message(message, "<?> should have been thrown.", expected_object) | ||||
|             assert_block(full_message){caught} | ||||
|           rescue ArgumentError => error | ||||
|             if UncaughtThrow[error.class] !~ error.message | ||||
|               raise error | ||||
|             end | ||||
|             full_message = build_message(message, "<?> expected to be thrown but\n<#$1> was thrown.", expected_value) | ||||
|             full_message = build_message(message, "<?> expected to be thrown but\n<#$1> was thrown.", expected_object) | ||||
|             flunk(full_message) | ||||
|           end | ||||
|         end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 gotoyuzo
						gotoyuzo