Created
November 4, 2014 01:58
-
-
Save rubygeek/0a4f6597cff3185d235a to your computer and use it in GitHub Desktop.
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
require 'minitest/autorun' | |
# Expectations: http://bfts.rubyforge.org/minitest/MiniTest/Expectations.html | |
# Help create test cases: http://www.cleavebooks.co.uk/scol/calnumba.htm | |
class Converter | |
end | |
describe Converter do | |
before do | |
@con = Converter.new | |
end | |
it "base 2 converts 101 to 5" do | |
@con.convert(2, 101).to eq 5 | |
end | |
it "base 3 converts 111 to 13" do | |
@con.convert(3, 111).to eq 13 | |
end | |
it "base 6 converts 22 to 14" do | |
@con.convert(6, 11).to eq 14 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment