Sha256: 1bc0e6b8976a33dc7b85e51457381bd7141dc7b7b21929cede3e40b07460317b

Contents?: true

Size: 738 Bytes

Versions: 18

Compression:

Stored size: 738 Bytes

Contents

require 'helper'

class TestLicenseeLicenseFile < Minitest::Test

  def setup
    @repo = Rugged::Repository.new(fixture_path("licenses.git"))
    blob = 'bcb552d06d9cf1cd4c048a6d3bf716849c2216cc'
    @file = Licensee::LicenseFile.new(@repo.lookup(blob))
    @gpl = Licensee::Licenses.find "GPL-3.0"
    @mit = Licensee::Licenses.find "MIT"
  end

  should "read the file" do
    assert @file.contents =~ /MIT/
  end

  should "match the license" do
    assert_equal "mit", @file.match.key
  end

  should "diff the file" do
    expected = "-Copyright (c) [year] [fullname]\n+Copyright (c) 2014 Ben Balter"
    assert @file.diff.include?(expected)
  end

  should "calculate confidence" do
    assert_equal 94, @file.confidence
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
licensee-4.5.0 test/test_licensee_license_file.rb
licensee-4.4.2 test/test_licensee_license_file.rb
licensee-4.4.1 test/test_licensee_license_file.rb
licensee-4.4.0 test/test_licensee_license_file.rb
licensee-4.3.3 test/test_licensee_license_file.rb
licensee-4.3.2 test/test_licensee_license_file.rb
licensee-4.3.1 test/test_licensee_license_file.rb
licensee-4.3.0 test/test_licensee_license_file.rb
licensee-4.2.4 test/test_licensee_license_file.rb
licensee-4.2.3 test/test_licensee_license_file.rb
licensee-4.2.2 test/test_licensee_license_file.rb
licensee-4.2.1 test/test_licensee_license_file.rb
licensee-4.2.0 test/test_licensee_license_file.rb
licensee-4.1.2 test/test_licensee_license_file.rb
licensee-4.1.1 test/test_licensee_license_file.rb
licensee-4.1.0 test/test_licensee_license_file.rb
licensee-4.0.1 test/test_licensee_license_file.rb
licensee-4.0.0 test/test_licensee_license_file.rb