I have module Database with method generate_from_database that spins for loops and calls method get_length. How can I test if get_length was called n times, by using rspec or mocha?
module Database
class Length < ActiveRecord::Base
def get_length(i,j)
...
end
end
def Database.generate_from_database
...
for i in 0...size
for j in 0...size
Length.new.get_length(i+1,j+1))
end
end