Sha256: fd883512f5574f76c7e3a738fb9da7469119cc265ab6c2dda938c41df04706ff

Contents?: true

Size: 993 Bytes

Versions: 8

Compression:

Stored size: 993 Bytes

Contents

require 'helper'

class TestLicenseeNpmBowerMatcher < Minitest::Test

  def setup
    Licensee.package_manager_files = true
  end

  def teardown
    Licensee.package_manager_files = false
  end

  should "detect NPM files" do
    project = Licensee::Project.new fixture_path "npm"
    matcher = Licensee::NpmBowerMatcher.new(project.package_file)
    assert_equal "mit", matcher.send(:license_property)
    assert_equal "mit", matcher.match.key
  end

  should "detect Bower files" do
    project = Licensee::Project.new fixture_path "bower"
    matcher = Licensee::NpmBowerMatcher.new(project.package_file)
    assert_equal "mit", matcher.send(:license_property)
    assert_equal "mit", matcher.match.key
  end

  should "not err on non-spdx licenses" do
    project = Licensee::Project.new fixture_path "npm-non-spdx"
    matcher = Licensee::NpmBowerMatcher.new(project.package_file)
    assert_equal "mit-1.0", matcher.send(:license_property)
    assert_equal nil, matcher.match
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
licensee-5.0.0 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b7 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b6 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b5 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b4 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b3 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b2 test/test_licensee_npm_bower_matcher.rb
licensee-5.0.0b1 test/test_licensee_npm_bower_matcher.rb