Add an example for method matching on memoizer
This commit is contained in:
parent
68e983d357
commit
ad972bcc00
1 changed files with 14 additions and 1 deletions
|
@ -8,7 +8,7 @@ describe Mutant::Matcher::Method::Instance do
|
|||
describe '#each' do
|
||||
subject { object.each { |subject| yields << subject } }
|
||||
|
||||
let(:object) { described_class.new(env, scope, method) }
|
||||
let(:object) { described_class.build(env, scope, method) }
|
||||
let(:method) { scope.instance_method(method_name) }
|
||||
let(:yields) { [] }
|
||||
let(:namespace) { self.class }
|
||||
|
@ -36,6 +36,19 @@ describe Mutant::Matcher::Method::Instance do
|
|||
it_should_behave_like 'a method matcher'
|
||||
end
|
||||
|
||||
context 'when method is defined once with a memoizer' do
|
||||
let(:base) { __LINE__ }
|
||||
class self::Foo
|
||||
def bar; end
|
||||
include Adamantium
|
||||
memoize :bar
|
||||
end
|
||||
|
||||
let(:method_line) { 2 }
|
||||
|
||||
it_should_behave_like 'a method matcher'
|
||||
end
|
||||
|
||||
context 'when method is defined multiple times' do
|
||||
context 'on differend lines' do
|
||||
let(:base) { __LINE__ }
|
||||
|
|
Loading…
Reference in a new issue