Skip to content

Instantly share code, notes, and snippets.

@kavu
Last active December 12, 2015 01:28
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 kavu/4691445 to your computer and use it in GitHub Desktop.
Save kavu/4691445 to your computer and use it in GitHub Desktop.
require 'minitest/autorun'
class MyClass
def initialize
@a = 1
end
def a
"not a 1"
end
end
class TestMeme < MiniTest::Unit::TestCase
def setup
@var = MyClass.new
end
def test_case
assert_equal(1, @var.send('a'), "This should fail")
assert_equal(1, @var.instance_variable_get(:@a))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment