Advertisement
nii236

Untitled

Jan 28th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.82 KB | None | 0 0
  1. def test_calling_global_methods_with_wrong_number_of_arguments            
  2.   exception = assert_raise(ArgumentError) do                              
  3.     my_global_method                                                      
  4.   end                                                                    
  5.   assert_match("wrong number of arguments (0 for 2)", exception.message)  
  6.                                                                          
  7.   exception = assert_raise(ArugmentError) do                              
  8.     my_global_method(1,2,3)                                              
  9.   end                                                                    
  10.   assert_match("wrong number of arguments (3 for 2)", exception.message)  
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement