Sha256: 6af9cb6f118b8196303af656035ac3eb6e01537047d0a08af4fe16fb428fa581

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Licensee::Matchers::Matcher do
  let(:mit) { Licensee::License.find('mit') }
  let(:content) { sub_copyright_info(mit) }
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }
  subject { described_class.new(file) }

  it 'stores the file' do
    expect(subject.file).to eql(file)
  end

  it 'returns its name' do
    expect(subject.name).to eql(:matcher)
  end

  context 'to_h' do
    class MatcherSpecFixture < Licensee::Matchers::Matcher
      def confidence
        0
      end
    end

    subject { MatcherSpecFixture.new(file) }
    let(:hash) { subject.to_h }
    let(:expected) do
      {
        confidence: 0,
        name:       :matcherspecfixture
      }
    end

    it 'converts to a hash' do
      expect(hash).to eql(expected)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
licensee-9.12.0 spec/licensee/matchers/matcher_spec.rb