Open
Conversation
carlabosco
reviewed
Aug 15, 2019
| require 'minitest/autorun' | ||
| require_relative 'roman_numerals' | ||
|
|
||
| # Common test data version: 1.0.0 070e8d5 |
|
I like how you committed your tests before committing your code. Red-green-refactor! |
shirley1chu
reviewed
Aug 15, 2019
| end | ||
|
|
||
| def to_roman | ||
| n = self |
There was a problem hiding this comment.
would benefit to leave comment that n is an instance of Fixnum, which gets converted to roman via to_roman
kdow
reviewed
Aug 15, 2019
| @@ -0,0 +1,30 @@ | |||
| class Fixnum | |||
|
|
|||
| def roman | |||
cyndilopez
reviewed
Aug 15, 2019
paulentine
reviewed
Aug 15, 2019
| result = "" | ||
| roman.each do |num, letter| | ||
| result << letter * (n / num) | ||
| n = n % num |
There was a problem hiding this comment.
Can be slightly shortened with n %= num
Kimberly-Fasbender
suggested changes
Aug 15, 2019
| end | ||
|
|
||
| def test_2 | ||
| skip |
There was a problem hiding this comment.
Do we want to be skipping these tests? We probably want to comment these out.
| @@ -0,0 +1,30 @@ | |||
| class Fixnum | |||
|
|
|||
| def roman | |||
There was a problem hiding this comment.
What do we think about making this an instance variable vs. a function?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.