Skip to content

roman-numerals 1.0.0.2: add descriptions #535

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
May 9, 2017
Merged

roman-numerals 1.0.0.2: add descriptions #535

merged 1 commit into from
May 9, 2017

Conversation

petertseng
Copy link
Member

@petertseng
Copy link
Member Author

I'm not sure if there was a reasonable way to split the commit apart (whitespace change) to make ti easier. I generated these programmatically.

require 'json'

json = JSON.parse(File.read(File.join(__dir__, 'canonical-data.json')))

json['cases'].each { |c|
  puts "        , Case { description = \"#{c['description']}\""
  puts "               , number      = #{c['number']}"
  puts "               , expected    = Just \"#{c['expected']}\""
  puts "               }"
}

... has anyone been doing these for any of the other tests?

@rbasso
Copy link
Contributor

rbasso commented May 9, 2017

... has anyone been doing these for any of the other tests?

No, but I envy your magic code snippet. 👍

@@ -17,66 +17,85 @@ specs = describe "roman-numerals" $

test Case{..} = it explanation assertion
where
explanation = show number
explanation = show number ++ ": " ++ description
Copy link
Member Author

Choose a reason for hiding this comment

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

like "27: 20 is two X's"

I wanted to keep the actual number being tested because in some cases the number in the description is not the input. Thought it might have been confusing to have the test output "20 is two X's" when the input is 27

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah! The 27's description is confusing...

I still prefer the assertEqual solution, instead of changing the test's description, because it is shown only when it fails.

Anyway, you solution definitely solves the problem here! 👍

@@ -17,66 +17,85 @@ specs = describe "roman-numerals" $

test Case{..} = it explanation assertion
where
explanation = show number
explanation = show number ++ ": " ++ description
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah! The 27's description is confusing...

I still prefer the assertEqual solution, instead of changing the test's description, because it is shown only when it fails.

Anyway, you solution definitely solves the problem here! 👍

petertseng added a commit that referenced this pull request May 9, 2017
* bowling 1.0.0.2: drop unneeded rolls, edit a description
* leap 1.0.0.2: explain criteria in descriptions, put in progress order
* luhn 1.0.0.2: only test isValid, use (most) x-common cases
* phone-number 1.2.0.3: enforce area/exchange not starting with 1
* roman-numerals 1.0.0.2: add descriptions
@petertseng
Copy link
Member Author

Thanks for the reviews! Octomerging soon, then seeing what to do about pov.

@petertseng petertseng merged commit 11963b4 into exercism:master May 9, 2017
@petertseng petertseng deleted the roman branch May 9, 2017 03:49
@petertseng
Copy link
Member Author

petertseng commented May 9, 2017

38 minutes from declaration of "Octomerging soon" to actual merge for 5 PRs, so it is not sure whether it is a time savings (depends on how long each Travis build would have taken), but at least it saves me from having to rebase and click buttons all the time.

I still maintain that it's a win.

I don't expect to have to do that too often though. Only when there are a lot of simultaneous PRs in flight, and since the last one I'm dealing with now is POV, we will be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants