[rspec-users] How to test a method that return random values

Guilherme javaplayer at gmail.com
Tue Jul 6 14:35:14 EDT 2010


Hi,

How can I test this method using rspec ?

def self.generate_calculation number1, number2, operation
      number1 = rand(number1)
      number2 = rand(number2)
      ...
end

This method return an operation with those random numbers.

Any tip ?


More information about the rspec-users mailing list