Skip to content

Instantly share code, notes, and snippets.

@PamBWillenz
Last active August 29, 2015 14:18
Show Gist options
  • Save PamBWillenz/4917d162f1a8b594acce to your computer and use it in GitHub Desktop.
Save PamBWillenz/4917d162f1a8b594acce to your computer and use it in GitHub Desktop.
Debugging Code
# a + " + " + b + " = " + (a + b)
def add(a,b)
"#{a} + #{b} = #{a+b}"
end
p add(1,2)
p add(5,7)
p add(10,12)
OUTPUT
"1 + 2 = 3"
"5 + 7 = 12"
"10 + 12 = 22"
# describe "add" do
# it "returns a string with 1 and 2 added" do
# expect( add(1,2) ).to eq("1 + 2 = 3")
# end
# it "returns a string with 5 and 7 added" do
# expect( add(5,7) ).to eq("5 + 7 = 12")
# end
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment