Sha256: e6a71d1c03acbc7361fed49d0af5df9407b22a34a4cc49842c66de74dd83d525

Contents?: true

Size: 780 Bytes

Versions: 8

Compression:

Stored size: 780 Bytes

Contents

# encoding: utf-8

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(described_class.new(cache, scope, method)) }
    end

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

      it { should eql(described_class::Memoized.new(cache, scope, method)) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.3.1 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.rc5 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.rc4 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.rc3 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.rc2 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.rc1 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
mutant-0.3.0.beta22 spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb