Last active
July 18, 2019 17:27
-
-
Save rjfranco/48ff9049ab2bcb105cec5e22bd939b8b to your computer and use it in GitHub Desktop.
Sample ruby add and test
This file contains hidden or 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
def add(n, n2) | |
n + n2 | |
end |
This file contains hidden or 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
require 'rspec' | |
describe add do | |
it "should add two numbers" do | |
total = add(2, 2) | |
expect(total).to eq(4) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment