Sha256: 56d17af6ec5eac82278f9b3c77eb007cdde067961bf72b3e42177b565332d4a8

Contents?: true

Size: 890 Bytes

Versions: 8

Compression:

Stored size: 890 Bytes

Contents

RSpec.describe Licensee::Matchers::DistZilla do
  let(:mit) { Licensee::License.find('mit') }
  let(:content) { 'license = MIT' }
  let(:file) { Licensee::Project::LicenseFile.new(content, 'dist.ini') }
  subject { described_class.new(file) }

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

  it 'has confidence' do
    expect(subject.confidence).to eql(90)
  end

  it 'matches' do
    expect(subject.match).to eql(mit)
  end

  {
    'spdx name'     => ['license = MIT', 'mit'],
    'non spdx name' => ['license = Mozilla_2_0', 'mpl-2.0']
  }.each do |description, license_declaration_and_key|
    context "with a #{description}" do
      let(:content) { license_declaration_and_key[0] }
      let(:license) { Licensee::License.find(license_declaration_and_key[1]) }

      it 'matches' do
        expect(subject.match).to eql(license)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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