Skip to content

Instantly share code, notes, and snippets.

@jonallured
Created October 11, 2013 14:38
Show Gist options
  • Save jonallured/6935777 to your computer and use it in GitHub Desktop.
Save jonallured/6935777 to your computer and use it in GitHub Desktop.
Calc converter
class Converter
def initialize(input)
@input = input
end
def convert
"3 + 2"
end
end
describe Converter do
it "moves arguments around" do
converter = Converter.new("(+ 3 2")
converter.convert.should eq "3 + 2"
end
end
@jonallured
Copy link
Author

This is obviously dumb because line 7 is just spitting back what line 14 is expecting, but your question was about structuring the spec file, so that's what I focused on. The next step here would be to add an assertion for your next test case and then actually begin the implementation.

Hope this helps!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment