Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active September 7, 2019 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/859eff9f86907e5efd895038633d4dca to your computer and use it in GitHub Desktop.
Save havenwood/859eff9f86907e5efd895038633d4dca to your computer and use it in GitHub Desktop.
Intelo
# 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
@havenwood
Copy link
Author

# Running:

F

Failure:
Intelo's problem#test_0001_is as desired [intelo.rb:8]:
Expected: 13
  Actual: nil


rails test intelo.rb:7



Finished in 0.001218s, 821.0181 runs/s, 821.0181 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment