-
-
Save halorgium/5883863 to your computer and use it in GitHub Desktop.
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
class WTF | |
attr_reader :color | |
def initialize | |
@color = 'red' | |
end | |
def color_with_self | |
color = self.color | |
color | |
end | |
def color_without_self | |
color = color | |
color | |
end | |
end | |
require "test/unit" | |
class WTFTest < Test::Unit::TestCase | |
def test_with_self | |
assert_equal "red", WTF.new.color_with_self | |
end | |
def test_without_self | |
assert_equal "red", WTF.new.color_without_self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment