Sha256: fce12269037ca0bb07f798526eec5234f6674a36ceed47956d8a2093cb8e91f6

Contents?: true

Size: 672 Bytes

Versions: 14

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Licensee::Matchers::Exact do
  subject { described_class.new(file) }

  let(:mit) { Licensee::License.find('mit') }
  let(:content) { sub_copyright_info(mit) }
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }

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

  it 'matches' do
    expect(content).to be_detected_as(mit)
  end

  it 'is confident' do
    expect(subject.confidence).to be(100)
  end

  context 'with extra words added' do
    let(:content) { add_random_words(mit.content) }

    it "doesn't match" do
      expect(subject.match).to be_nil
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
licensee-9.18.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.17.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.17.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.16.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.16.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.15.3 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.15.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.15.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.15.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.14.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.14.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.13.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.13.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.13.0 spec/licensee/matchers/exact_matcher_spec.rb