Skip to content

Instantly share code, notes, and snippets.

@sunnyrjuneja
Created December 9, 2016 03:12
Show Gist options
  • Save sunnyrjuneja/50592c8c5a84d84b76d442ee113df829 to your computer and use it in GitHub Desktop.
Save sunnyrjuneja/50592c8c5a84d84b76d442ee113df829 to your computer and use it in GitHub Desktop.
class TestCase1
if false
def foo
'Hello World'
end
end
end
puts TestCase1.new.foo # test.rb:9:in `<main>': undefined method `foo' for #<TestCase1:0x007ffff35bfe78> (NoMethodError)
class TestCase2
if true
def foo
'Hello World'
end
end
end
puts TestCase2.new.fo() # test.rb:19:in `<main>': undefined method `fo' for #<TestCase2:0x007fffbcd27f80> (NoMethodError)
# Did you mean? foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment