- Fork and clone this repo.
- Run
bundle
. - Open
math_spec.rb
. - Write tests for the methods inside of
lib/math.rb
. - For every test you write, run
rspec
to run your tests. - For every method, write one example group (
it
block) with 3 different expectations.- The expectations should be very similar. Your expectations should test that passing in particular inputs results in expected output.
- The expectations should differ by passing in different parameters for each one.
- You have 25 minutes.
Suppose we had the following method:
def sum(*args)
args.reduce(:+)
end
A successful test would check that:
sum(2,3)
returns5
sum(5,6)
returns11
sum(-10,32)
returns22