2015-04-26 14:52:02 -04:00
|
|
|
require 'adamantium'
|
|
|
|
|
2014-10-17 18:54:13 -04:00
|
|
|
original = $VERBOSE
|
2015-10-28 16:13:00 -04:00
|
|
|
# Silence intentional violations made to exercise the method matcher edge cases.
|
|
|
|
# This is NOT representative for could you should write!
|
2014-10-17 18:54:13 -04:00
|
|
|
$VERBOSE = false
|
2015-10-28 16:13:00 -04:00
|
|
|
# Namespace for test application
|
2012-08-09 14:04:03 -04:00
|
|
|
module TestApp
|
2014-09-16 15:30:45 -04:00
|
|
|
module InstanceMethodTests
|
2018-11-06 14:06:04 -05:00
|
|
|
module WithMemoizer
|
2014-09-16 15:30:45 -04:00
|
|
|
include Adamantium
|
2015-10-28 16:13:00 -04:00
|
|
|
|
|
|
|
def bar; end; def baz; end
|
|
|
|
eval('def boz; end')
|
|
|
|
def foo; end;
|
2014-09-16 15:30:45 -04:00
|
|
|
memoize :foo
|
|
|
|
end
|
|
|
|
|
|
|
|
module DefinedMultipleTimes
|
|
|
|
class DifferentLines
|
|
|
|
def foo
|
|
|
|
end
|
|
|
|
|
|
|
|
def foo(_arg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class SameLineSameScope
|
|
|
|
def foo; end; def foo(_arg); end
|
|
|
|
end
|
|
|
|
|
|
|
|
class SameLineDifferentScope
|
|
|
|
def self.foo; end; def foo(_arg); end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class InClassEval
|
|
|
|
class_eval do
|
|
|
|
def foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class InModuleEval
|
|
|
|
module_eval do
|
|
|
|
def foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class InInstanceEval
|
|
|
|
module_eval do
|
|
|
|
def foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module SingletonMethodTests
|
|
|
|
module DefinedOnSelf
|
|
|
|
def self.foo; end
|
|
|
|
end
|
|
|
|
|
2015-10-28 16:13:00 -04:00
|
|
|
module DefinedOnLvar
|
|
|
|
a = self
|
|
|
|
def a.foo; end
|
2014-09-16 15:30:45 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
module DefinedOnConstant
|
|
|
|
module InsideNamespace
|
|
|
|
def InsideNamespace.foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module OutsideNamespace
|
|
|
|
end
|
|
|
|
|
|
|
|
def OutsideNamespace.foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module DefinedMultipleTimes
|
|
|
|
module DifferentLines
|
|
|
|
def self.foo
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.foo(_arg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module SameLine
|
|
|
|
module SameScope
|
2015-10-28 16:13:00 -04:00
|
|
|
def self.foo; end; def self.foo(_arg); end
|
2014-09-16 15:30:45 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
module DifferentScope
|
2015-10-28 16:13:00 -04:00
|
|
|
def self.foo; end; def DifferentScope.foo(_arg); end; def SingletonMethodTests.foo; end
|
|
|
|
end
|
|
|
|
|
|
|
|
module DifferentName
|
|
|
|
def self.foo; end; def self.bar(_arg); end
|
2014-09-16 15:30:45 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-08-09 14:04:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
require 'test_app/literal'
|
2014-10-17 18:54:13 -04:00
|
|
|
$VERBOSE = original
|