-
-
Save havenwood/859eff9f86907e5efd895038633d4dca to your computer and use it in GitHub Desktop.
Intelo
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
# given | |
foo(6, 7) | |
# then | |
#=> 13 | |
# given | |
foo(1, -1) | |
# then | |
#=> 0 | |
## | |
# Or another way | |
# given | |
a = 6 | |
b = 7 | |
# then | |
13 | |
# given | |
a = 1 | |
b = -1 | |
# then | |
0 | |
## | |
# Or, better yet | |
require 'minitest/autorun' | |
def foo(a, b) | |
end | |
describe "Intelo's problem" do | |
it 'is as desired' do | |
assert_equal 13, foo(6, 7) | |
assert_equal 0, foo(1, -1) | |
end | |
end | |
Author
havenwood
commented
Sep 7, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment