Sha256: a4a436819daba3be247e26b6f6785bf3805290dedf9bfa03209fa847dc09e50b

Contents?: true

Size: 806 Bytes

Versions: 10

Compression:

Stored size: 806 Bytes

Contents

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

10 entries across 10 versions & 1 rubygems

Version Path
licensee-9.11.0 spec/licensee/matchers/matcher_spec.rb
licensee-9.10.1 spec/licensee/matchers/matcher_spec.rb
licensee-9.10.0 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.4 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.3 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.2 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.1 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.0 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.0.beta.3 spec/licensee/matchers/matcher_spec.rb
licensee-9.9.0.beta.2 spec/licensee/matchers/matcher_spec.rb