Skip to content

Test Fixnum#underscore#652

Merged
kotp merged 2 commits intoexercism:masterfrom
Insti:Test_Underscore_Fixnum
May 21, 2017
Merged

Test Fixnum#underscore#652
kotp merged 2 commits intoexercism:masterfrom
Insti:Test_Underscore_Fixnum

Conversation

@Insti
Copy link
Copy Markdown
Contributor

@Insti Insti commented May 21, 2017

#583 Added a refinement to Fixnum to convert integers into their underscored string representation.

This PR adds a unit test to bring us back up to 100% test coverage.

@Insti Insti added the ready label May 21, 2017
@Insti Insti requested a review from kotp May 21, 2017 07:07
Comment thread test/generator/underscore_test.rb Outdated
end

def test_fixnum_underscore
assert_equal '1_000_000', 1_000_000.underscore
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests should test from a "raw" number, such as 1000000 rather than one with underscores, otherwise why would the call be needed? (Yes, it is needed to also convert it to a string... but this is not clear in the name, especially since the number already has underscores that it is being called on.)

Remove underscores from the Fixnum representation of the number we're
testing the underscoring of.

This is unnecessary since 1_000_000 == 1000000 and
1_000_000.to_s = "1000000" but it helps to illustrate the purpose of the
method.
@kotp kotp merged commit 70dd104 into exercism:master May 21, 2017
@Insti Insti deleted the Test_Underscore_Fixnum branch May 21, 2017 21:40
@Insti Insti removed the ready label May 21, 2017
@Insti Insti removed the ready label Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants