-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathtest.rb
More file actions
58 lines (40 loc) · 1.22 KB
/
test.rb
File metadata and controls
58 lines (40 loc) · 1.22 KB
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
48
49
50
51
52
53
54
55
56
57
58
require './test_setup'
require './methods'
describe 'Methods' do
describe 'sleep_in' do
it 'should sleep in on the weekend at home' do
sleep_in?(false, false).must_equal(true)
end
it 'should not sleep in during the week at home' do
sleep_in?(true, false).must_equal(false)
end
it 'should sleep in on vacation on the weekend' do
sleep_in?(false, true).must_equal(true)
end
it 'should sleep on vacation during the week' do
sleep_in?(true, true).must_equal(true)
end
end
describe 'monkey_trouble' do
it 'is trouble when both monkeys are smiling' do
monkey_trouble?(false, false).must_equal(true)
end
it 'is not trouble when only A is smiling' do
monkey_trouble?(true, false).must_equal(false)
end
it 'is not trouble when only B is smiling' do
monkey_trouble?(false, true).must_equal(false)
end
it 'is trouble when neither monkey is smiling' do
monkey_trouble?(false, false).must_equal(true)
end
end
describe 'sum_double' do
it 'finds the sum' do
sum_double(1, 2).must_equal(3)
end
it 'doubles the sum when the numbers are the same' do
sum_double(3, 3).must_equal(12)
end
end
end