Should repeat a number of times

后端 未结 3 1226
难免孤独
难免孤独 2021-01-16 16:44

Here is simon_says_spec.rb

require simon_says
     describe \"repeat\" do
        it \"should repeat\" do
          repeat(\"hello\").should == \"hello hello         


        
3条回答
  •  野的像风
    2021-01-16 17:23

    You are missing the end statement for your do loop.

    def repeat(x, y = 2)
        y.times do print x + ' ' end
    end
    

提交回复
热议问题