Guest User

Untitled

a guest
Apr 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. require File.join(File.dirname(__FILE__), "..", "spec_helper")
  2.  
  3. describe Clock do
  4. before_all do
  5. @clock = Erlang.module(:clock)
  6. @myclock = MyClock.new
  7. end
  8.  
  9. it "should 3 for soma method" do
  10. fun = lambda { @myclock.soma += 1 }
  11. @clock.start(100, fun)
  12. sleep(350)
  13. @clock.stop()
  14. @myclock.soma.should == 3
  15. end
  16. end
  17.  
  18. class MyClock
  19. attr_accessor :soma
  20.  
  21. def initialize
  22. @soma = 0
  23. end
  24. end
Add Comment
Please, Sign In to add comment