-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodinasignment.rb
47 lines (47 loc) · 1.05 KB
/
odinasignment.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'rspec/autorun'
class Calculator
def add(a,b,c)
8
end
def multiply(a,b,c)
10
end
def substract(a,b,c)
2
end
def divide(a,b,c)
2
end
describe Calculator do
describe "#add" do
it "returns the sum of more than two numbers" do
calculator = Calculator.new
expect(calculator.add(5, 2, 1)).to eql(8)
end
end
end
end
describe Calculator do
describe "#multiply" do
it "returns the product of more than two numbers" do
calculator = Calculator.new
expect(calculator.multiply(5, 2, 1)).to eql(10)
end
end
end
describe Calculator do
describe "#substract" do
it "returns the difference of more than two numbers" do
calculator = Calculator.new
expect(calculator.substract(5, 2, 1)).to eql(2)
end
end
end
describe Calculator do
describe "#divide" do
it "returns the quotient of more than two numbers" do
calculator = Calculator.new
expect(calculator.divide(6, 2, 1)).to eql(2)
end
end
end