|
47 | 47 | expect(multiply(3, 4)).to eq(12) |
48 | 48 | end |
49 | 49 |
|
50 | | - it "multiplies two other numbers" |
| 50 | + it "multiplies two other numbers" do |
51 | 51 | # one other test here, don't forget do end ;) |
| 52 | + expect(multiply(5, 10)).to eq(50) |
| 53 | + end |
52 | 54 |
|
53 | | - it "multiplies two other numbers, one of them being 0" |
| 55 | + it "multiplies two other numbers, one of them being 0" do |
54 | 56 | # one last test, with 0 in it |
55 | | - |
| 57 | + expect(multiply(71, 0)).to eq(0) |
| 58 | + end |
56 | 59 | end |
57 | 60 |
|
58 | 61 | describe "#power" do |
59 | | - it "raises one number to the power of another number" |
| 62 | + it "raises one number to the power of another number" do |
| 63 | + expect(power(2)).to eq(4) |
| 64 | + end |
60 | 65 | end |
61 | 66 |
|
62 | 67 | # http://en.wikipedia.org/wiki/Factorial |
63 | 68 | describe "#factorial" do |
64 | | - it "computes the factorial of 0" |
65 | | - it "computes the factorial of 1" |
66 | | - it "computes the factorial of 2" |
67 | | - it "computes the factorial of 5" |
68 | | - it "computes the factorial of 10" |
| 69 | + it "computes the factorial of 0" do |
| 70 | + expect(factorial(0)).to eq(0) |
| 71 | + end |
| 72 | + |
| 73 | + it "computes the factorial of 1" do |
| 74 | + expect(factorial(1).to eq(1)) |
| 75 | + end |
| 76 | + |
| 77 | + it "computes the factorial of 2" do |
| 78 | + expect(factorial(2).to eq(2)) |
| 79 | + end |
| 80 | + |
| 81 | + it "computes the factorial of 5" do |
| 82 | + expect(factorial(5).to eq(120)) |
| 83 | + end |
| 84 | + |
| 85 | + it "computes the factorial of 10" do |
| 86 | + expect(factorial(10).to eq(3628800)) |
| 87 | + end |
| 88 | + |
69 | 89 | end |
0 commit comments