Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created March 23, 2011 01:40
Show Gist options
  • Save Watson1978/882467 to your computer and use it in GitHub Desktop.
Save Watson1978/882467 to your computer and use it in GitHub Desktop.
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
class Foo
def respond_to_missing?(method, priv= false)
#puts "respond_to_missing? : " + method.inspect
method
end
end
obj = Foo.new
assert_equal(true, obj.respond_to?(:bar))
assert_match(/Foo#bar/, obj.public_method(:bar).inspect)
puts :ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment