Sha256: 402286ea4f2a819fe82bf6cf1b521d4790034733ed32d534cd37e1cff6a02a34

Contents?: true

Size: 641 Bytes

Versions: 17

Compression:

Stored size: 641 Bytes

Contents

RSpec.describe Licensee::Matchers::Exact 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 '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

17 entries across 17 versions & 1 rubygems

Version Path
licensee-9.11.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.10.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.10.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.4 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.3 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.0.beta.3 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.9.0.beta.2 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.8.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.7.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.6.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.5.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.4.0 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.3.1 spec/licensee/matchers/exact_matcher_spec.rb
licensee-9.3.0 spec/licensee/matchers/exact_matcher_spec.rb