Skip to content

Commit

Permalink
Test for incorrect greedy algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
kotp committed Aug 27, 2017
1 parent 0a36d22 commit c00d8c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion exercises/change/.meta/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
2
2 changes: 1 addition & 1 deletion exercises/change/.meta/solutions/change.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module BookKeeping
VERSION = 1
VERSION = 2
end

class Change
Expand Down
9 changes: 7 additions & 2 deletions exercises/change/change_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'minitest/autorun'
require_relative 'change'

# Common test data version: 1.0.0 3d8b5b3
# Common test data version: 1.1.0 52cf1cf
class ChangeTest < Minitest::Test
def test_single_coin_change
# skip
Expand Down Expand Up @@ -33,6 +33,11 @@ def test_possible_change_without_unit_coins_available
assert_equal [2, 2, 2, 5, 10], Change.generate([2, 5, 10, 20, 50], 21)
end

def test_another_possible_change_without_unit_coins_available
skip
assert_equal [4, 4, 4, 5, 5, 5], Change.generate([4, 5], 27)
end

def test_no_coins_make_0_change
skip
assert_equal [], Change.generate([1, 5, 10, 21, 25], 0)
Expand Down Expand Up @@ -72,6 +77,6 @@ def test_cannot_find_negative_change_values

def test_bookkeeping
skip
assert_equal 1, BookKeeping::VERSION
assert_equal 2, BookKeeping::VERSION
end
end

0 comments on commit c00d8c6

Please sign in to comment.