Sha256: 4699aeb9af49da78e56528514b914e2e1275218d2563c9f8a4610ab349f2fae7

Contents?: true

Size: 797 Bytes

Versions: 8

Compression:

Stored size: 797 Bytes

Contents

require 'spec_helper'

describe Mutant::Matcher::Method::Instance, '.build' do
  let(:object) { described_class }

  subject { object.build(cache, scope, method) }

  let(:cache) { double }

  let(:scope) do
    Class.new do
      include Adamantium

      def foo
      end
      memoize :foo

      def bar
      end
    end
  end

  let(:method) do
    scope.instance_method(method_name)
  end

  context 'with adamantium infected scope' do
    context 'with unmemoized method' do
      let(:method_name) { :bar }

      it { should eql(Mutant::Matcher::Method::Instance.new(cache, scope, method)) }
    end

    context 'with memoized method' do
      let(:method_name) { :foo }

      it { should eql(Mutant::Matcher::Method::Instance::Memoized.new(cache, scope, method)) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta20 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta19 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb