Sha256: 535481454dcf5381866442158e088f91d40479726f13f687a9411beac34bbefa

Contents?: true

Size: 644 Bytes

Versions: 8

Compression:

Stored size: 644 Bytes

Contents

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

  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 eql(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

8 entries across 8 versions & 1 rubygems

Version Path
licensee-8.9.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.9.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.5 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.4 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.3 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-8.8.0 spec/licensee/matchers/exact_matcher_spec.rb