I need to test a method which is as below
class Something
def test_method
count = 0
arr = []
max = 500
puts "test_method"
loop do
arr += count if count.even?
count += 1
end break if count > max
return arr
end
end
So basically I need to test whether test_method() return an instance of array and arr size is greater than 3. But I dont want to enter into this loop for every time and return the result. So is there any way in rspec where I can stub the max value and return the array without looping 500 times.