Sha256: 8c38dc67d96b27898385f0f4ed84b5daa6aec8edadc59e7ab1bf82212cc08f81

Contents?: true

Size: 844 Bytes

Versions: 9

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sinclair::Matchers::AddMethod do
  describe 'yard' do
    describe '#to' do
      context 'when checking against Class' do
        let(:clazz)   { Class.new }
        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 }
        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

9 entries across 9 versions & 1 rubygems

Version Path
sinclair-1.4.1 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.4.0 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.3.4 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.3.3 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.3.2 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.3.1 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.3.0 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.2.1 spec/integration/yard/sinclair/matchers/add_method_spec.rb
sinclair-1.2.0 spec/integration/yard/sinclair/matchers/add_method_spec.rb