Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
- describe Clock do
- before_all do
- @clock = Erlang.module(:clock)
- @myclock = MyClock.new
- end
- it "should 3 for soma method" do
- fun = lambda { @myclock.soma += 1 }
- @clock.start(100, fun)
- sleep(350)
- @clock.stop()
- @myclock.soma.should == 3
- end
- end
- class MyClock
- attr_accessor :soma
- def initialize
- @soma = 0
- end
- end
Add Comment
Please, Sign In to add comment