Skip to content

Change: Test for incorrect greedy algorithm #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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