Created
May 29, 2014 16:37
-
-
Save ToadJamb/d8d0da81d6c6b929f346 to your computer and use it in GitHub Desktop.
ruby weirdness
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
| class TestApp | |
| def run | |
| puts "foo is correctly 'foo': #{foo.inspect}" | |
| unless foo | |
| puts 'foo is nil' # This line is never hit, but the next line appears to get executed. | |
| foo = nil # Remove this line and it works as expected. | |
| end | |
| puts "foo is incorrectly nil: #{foo.inspect}" | |
| end | |
| def foo | |
| 'foo' | |
| end | |
| end | |
| TestApp.new.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment