Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.46 KB | None | 0 0
  1.  def test_default_value          
  2.    hash1 = Hash.new              
  3.    hash1[:one] = 1                
  4.                                  
  5.    assert_equal 1, hash1[:one]    
  6.    assert_equal nil, hash1[:two]  
  7.                                  
  8.    hash2 = Hash.new("dos")        
  9.    hash2[:one] = 1                
  10.                                  
  11.    assert_equal 1, hash2[:one]    
  12.    assert_equal nil, hash2[:two]  
  13.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement