Skip to content

Instantly share code, notes, and snippets.

@rubygeek
Created November 4, 2014 01:58
Show Gist options
  • Save rubygeek/0a4f6597cff3185d235a to your computer and use it in GitHub Desktop.
Save rubygeek/0a4f6597cff3185d235a to your computer and use it in GitHub Desktop.
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