嗨需要幫助與此rspec測試我想通過一定的方法。問題是我不知道它的要求。這是我試圖通過的測試。紅寶石Rspec測試
describe "repeater" do
it "executes the default block" do
block_was_executed = false
repeater do
block_was_executed = true
end
block_was_executed.should == true
end
it "executes the default block 3 times" do
n = 0
repeater(3) do
n += 1
end
n.should == 3
end
it "executes the default block 10 times" do
n = 0
repeater(10) do
n += 1
end
n.should == 10
end
end
我真的不明白什麼,我需要做的,使這個測試通過,因爲我真的不知道它的要價。如果可以用文字解釋,但實際上並沒有給我的代碼讓它通過,那將是非常棒的!
不是家庭作業我只是想爲自己找出代碼的一部分。 – Evan 2013-03-22 02:23:14