Sha256: 11551dddefeb48891caef4f888bd694f58506c05b6bd3b517d3fa232ecce39fb

Contents?: true

Size: 1.72 KB

Versions: 21

Compression:

Stored size: 1.72 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Sinclair::Matchers do
  describe '#add_method' do
    it 'has been added to DSL' do
      expect(respond_to?(:add_method)).to be_truthy
    end

    it do
      expect(add_method(:method_name)).to be_a(described_class::AddInstanceMethod)
    end

    it 'returns the matcher with correct argument' do
      expect(add_method(:method_name)).to eq(described_class::AddInstanceMethod.new(:method_name))
    end
  end

  describe '#add_class_method' do
    it 'has been added to DSL' do
      expect(respond_to?(:add_class_method)).to be_truthy
    end

    it do
      expect(add_class_method(:method_name)).to be_a(described_class::AddClassMethod)
    end

    it 'returns the matcher with correct argument' do
      expect(add_class_method(:method_name))
        .to eq(described_class::AddClassMethod.new(:method_name))
    end
  end

  describe '#change_method' do
    it 'has been added to DSL' do
      expect(respond_to?(:change_method)).to be_truthy
    end

    it do
      expect(change_method(:method_name)).to be_a(described_class::ChangeInstanceMethod)
    end

    it 'returns the matcher with correct argument' do
      expect(change_method(:method_name))
        .to eq(described_class::ChangeInstanceMethod.new(:method_name))
    end
  end

  describe '#change_class_method' do
    it 'has been added to DSL' do
      expect(respond_to?(:change_class_method)).to be_truthy
    end

    it do
      expect(change_class_method(:method_name)).to be_a(described_class::ChangeClassMethod)
    end

    it 'returns the matcher with correct argument' do
      expect(change_class_method(:method_name))
        .to eq(described_class::ChangeClassMethod.new(:method_name))
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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