Sha256: 62cffc1388ca2207dbfe63d725c01903e323c589c8fe532c2e036abc8fed9beb

Contents?: true

Size: 1.28 KB

Versions: 14

Compression:

Stored size: 1.28 KB

Contents

shared_context 'mock + strong' do
  include MockDefinitionCreatorHelpers

  context 'against instance methods', method_type: :instance do
    context 'that exist', methods_exist: true do
      include_context 'tests for a double definition creator method that supports mocking'

      it_behaves_like 'comparing the arity between the method and double definition'
    end

    context 'that do not exist', methods_exist: false do
      it "doesn't work" do
        object = Object.new
        double_creator = double_definition_creator_for(object)
        expect { double_creator.some_method }.to \
          raise_error(RR::Errors::SubjectDoesNotImplementMethodError)
      end
    end
  end

  context 'against class methods', method_type: :class do
    context 'that exist', methods_exist: true do
      include_context 'tests for a double definition creator method that supports mocking'

      it_behaves_like 'comparing the arity between the method and double definition'
    end

    context 'that do not exist', methods_exist: false do
      it "doesn't work" do
        klass = Class.new
        double_creator = double_definition_creator_for(klass)
        expect { double_creator.some_method }.to \
          raise_error(RR::Errors::SubjectDoesNotImplementMethodError)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rr-3.1.1 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.1.0 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.9 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.8 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.7 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.6 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.5 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.4 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.3 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.2 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.1 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-3.0.0 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-1.2.1 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb
rr-1.2.0 spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb