Skip to content

Instantly share code, notes, and snippets.

@mattsnyder
Created July 20, 2012 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattsnyder/3150540 to your computer and use it in GitHub Desktop.
Save mattsnyder/3150540 to your computer and use it in GitHub Desktop.
example specs for converting roman numerals
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