Skip to content

Instantly share code, notes, and snippets.

@joshuastr
Created May 2, 2016 13:15
Show Gist options
  • Save joshuastr/ca59977c041ccb482d3ac4e011f10d03 to your computer and use it in GitHub Desktop.
Save joshuastr/ca59977c041ccb482d3ac4e011f10d03 to your computer and use it in GitHub Desktop.
Debugging with rspec
### SETUP
require 'rspec'
### LOGIC (fix me)
class HelloWorld
def hello
@hello
end
def initialize(who)
@hello = who
puts "hello #{who}!"
end
end
# greeting = HelloWorld.new('world')
# greeting.hello
# TEST CODE (don't touch me)
describe '#hello' do
it 'returns "hello world!" when "world" is passed in' do
result = hello('world')
expect(result).to eq('hello world!')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment