-
-
Notifications
You must be signed in to change notification settings - Fork 531
change: Regenerate Tests #871
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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.2.0 044d09a | ||
| # Common test data version: 1.3.0 258c807 | ||
| class ChangeTest < Minitest::Test | ||
| def test_single_coin_change | ||
| # skip | ||
|
|
@@ -45,16 +45,22 @@ def test_no_coins_make_0_change | |
|
|
||
| def test_error_testing_for_change_smaller_than_the_smallest_of_coins | ||
| skip | ||
| assert_equal -1, Change.generate([5, 10], 3) | ||
| assert_raises(Change::ImpossibleCombinationError) do | ||
| Change.generate([5, 10], 3) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| end | ||
| end | ||
|
|
||
| def test_error_if_no_combination_can_add_up_to_target | ||
| skip | ||
| assert_equal -1, Change.generate([5, 10], 94) | ||
| assert_raises(Change::ImpossibleCombinationError) do | ||
| Change.generate([5, 10], 94) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| end | ||
| end | ||
|
|
||
| def test_cannot_find_negative_change_values | ||
| skip | ||
| assert_equal -1, Change.generate([1, 2, 5], -5) | ||
| assert_raises(Change::NegativeTargetError) do | ||
| Change.generate([1, 2, 5], -5) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(I don't think invalid input like this is something we should be testing for, but that's an unrelated issue. (and very much a matter of opinion.)) |
||
| end | ||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like these two 👍