Sha256: 6edc0dccc10aea95f25088016bac6421a7565280d21f20b524401da4d56b6ae5

Contents?: true

Size: 870 Bytes

Versions: 32

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sinclair::Matchers::AddInstanceMethod do
  describe 'yard' do
    describe '#to' do
      context 'when checking against Class' do
        let(:clazz)   { Class.new(MyModel) }
        let(:builder) { Sinclair.new(clazz) }

        before do
          builder.add_method(:new_method, '2')
        end

        it do
          expect { builder.build }.to add_method(:new_method).to(clazz)
        end
      end

      context 'when checking against instance' do
        let(:clazz)    { Class.new(MyModel) }
        let(:builder)  { Sinclair.new(clazz) }
        let(:instance) { clazz.new }

        before do
          builder.add_method(:the_method, 'true')
        end

        it do
          expect { builder.build }.to add_method(:the_method).to(instance)
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-2.1.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-2.0.1 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-2.0.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.16.3 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.16.2 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.16.1 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.16.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.15.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.14.2 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.14.1 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.14.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.13.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.12.1 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.12.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.11.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.10.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.9.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.8.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb
sinclair-1.7.0 spec/integration/yard/sinclair/matchers/add_instance_method_spec.rb