Created
July 20, 2012 12:45
-
-
Save mattsnyder/3150540 to your computer and use it in GitHub Desktop.
example specs for converting roman numerals
This file contains 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
describe "Converting integers to roman numerals" do | |
describe "with simple conversions" do | |
Then { 1.should be_converted_to 'I' } | |
Then { 5.should be_converted_to 'V' } | |
Then { 10.should be_converted_to 'X' } | |
end | |
describe "with additive conversions" do | |
Then { 3.should be_converted_to 'III' } | |
Then { 2.should be_converted_to 'II' } | |
Then { 20.should be_converted_to 'XX' } | |
end | |
describe "with combined conversions" do | |
Then { 6.should be_converted_to 'VI' } | |
Then { 11.should be_converted_to 'XI' } | |
Then { 12.should be_converted_to 'XII' } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment