Skip to content

Instantly share code, notes, and snippets.

@tfiechowski
Created April 10, 2019 08:08
Show Gist options
  • Save tfiechowski/7cc0e81b1c1be74ba62d535e1798114e to your computer and use it in GitHub Desktop.
Save tfiechowski/7cc0e81b1c1be74ba62d535e1798114e to your computer and use it in GitHub Desktop.
Sample RSpec unit test
class HelloWorld
def say_hello
"Hello World!"
end
end
describe HelloWorld do
context “When testing the HelloWorld class” do
it "should say 'Hello World' when we call the say_hello method" do
hw = HelloWorld.new
message = hw.say_hello
expect(message).to eq "Hello World!"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment