Skip to content

Instantly share code, notes, and snippets.

@BernardoMG
Created September 14, 2019 17:10
Show Gist options
  • Save BernardoMG/f05f28a8a930d929edf8d7ff5a8caf94 to your computer and use it in GitHub Desktop.
Save BernardoMG/f05f28a8a930d929edf8d7ff5a8caf94 to your computer and use it in GitHub Desktop.
require 'converter'
RSpec.describe Converter do
describe '#to_binary' do
it 'converts a number to binary' do
result = Converter.to_binary(2)
expect(result).to eq('10')
end
end
describe '#to_number' do
it 'converts a binary string to number' do
result = Converter.to_number('10')
expect(result).to eq(2)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment