-
-
Notifications
You must be signed in to change notification settings - Fork 521
/
Copy pathtwo_bucket_test.rb
60 lines (53 loc) · 1.98 KB
/
two_bucket_test.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
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'minitest/autorun'
require_relative 'two_bucket'
class TwoBucketTest < Minitest::Test
def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_one
# skip
subject = TwoBucket.new(3, 5, 1, "one")
assert_equal 4, subject.moves
assert_equal "one", subject.goal_bucket
assert_equal 5, subject.other_bucket
end
def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_two
skip
subject = TwoBucket.new(3, 5, 1, "two")
assert_equal 8, subject.moves
assert_equal "two", subject.goal_bucket
assert_equal 3, subject.other_bucket
end
def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_one
skip
subject = TwoBucket.new(7, 11, 2, "one")
assert_equal 14, subject.moves
assert_equal "one", subject.goal_bucket
assert_equal 11, subject.other_bucket
end
def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_two
skip
subject = TwoBucket.new(7, 11, 2, "two")
assert_equal 18, subject.moves
assert_equal "two", subject.goal_bucket
assert_equal 7, subject.other_bucket
end
def test_measure_one_step_using_bucket_one_of_size_1_and_bucket_two_of_size_3_start_with_bucket_two
skip
subject = TwoBucket.new(1, 3, 3, "two")
assert_equal 1, subject.moves
assert_equal "two", subject.goal_bucket
assert_equal 0, subject.other_bucket
end
def test_measure_using_bucket_one_of_size_2_and_bucket_two_of_size_3_start_with_bucket_one_and_end_with_bucket_two
skip
subject = TwoBucket.new(2, 3, 3, "one")
assert_equal 2, subject.moves
assert_equal "two", subject.goal_bucket
assert_equal 2, subject.other_bucket
end
def test_with_the_same_buckets_but_a_different_goal_then_it_is_possible
skip
subject = TwoBucket.new(6, 15, 9, "one")
assert_equal 10, subject.moves
assert_equal "two", subject.goal_bucket
assert_equal 0, subject.other_bucket
end
end