Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. require 'a'
  2.  
  3. class MyTestCase < A
  4.   def setup
  5.     @user = { :some => :object }
  6.   end
  7.  
  8.   def test_user_has_property
  9.     a @user[:some] == :object
  10.     a !@user[:other]
  11.   end
  12.  
  13.   def test_user_not_nil
  14.     a !@user.nil?
  15.   end
  16. end
  17.  
  18. class MyOtherTestCase < A
  19.   def setup
  20.     @foo = [1,2,3]
  21.   end
  22.  
  23.   def test_user_has_property
  24.     a @foo.length == 3
  25.     a @foo[2] > 934 # Should fail at line 27
  26.  
  27.     @foo[1] = 99
  28.  
  29.     a @foo[1] != 2
  30.   end
  31.  
  32.   def teardown
  33.     @user = nil
  34.   end
  35. end