Created
May 2, 2016 13:15
-
-
Save joshuastr/ca59977c041ccb482d3ac4e011f10d03 to your computer and use it in GitHub Desktop.
Debugging with rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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