Guest User

Untitled

a guest
May 27th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/spec_helper'
  2.  
  3. ARR = []
  4.  
  5. given "A" do
  6. ARR << 1
  7. end
  8.  
  9. given "B", :given => "A" do
  10. ARR << 2
  11. end
  12.  
  13. given "C", :given => "B" do
  14. ARR << 3
  15. end
  16.  
  17.  
  18. describe "Chaining calls to 'given'", :given => "C" do
  19. it "should behave like 'standard' constructor calls" do
  20. ARR.should == [1,2,3]
  21. end
  22. end
  23.  
  24. # PRINTS:
  25. # mungo:~/projects/merb_resource_controller snusnu$ spec spec/given_spec.rb
  26. # Chaining calls to 'given'
  27. # - should behave like 'standard' constructor calls (FAILED - 1)
  28. #
  29. # 1)
  30. # 'Chaining calls to 'given' should behave like 'standard' constructor calls' FAILED
  31. # expected: [1, 2, 3],
  32. # got: [3] (using ==)
  33. # ./spec/given_spec.rb:20:
  34. #
  35. # Finished in 0.015374 seconds
  36. #
  37. # 1 example, 1 failure
Add Comment
Please, Sign In to add comment