Sha256: 04ea0054d94d47816f0252f4988f9befc107ee6d6cf5d6c807d9cb2bcbdd88b0
Contents?: true
Size: 1.16 KB
Versions: 4
Compression:
Stored size: 1.16 KB
Contents
require 'helper' class TestLicenseeCopyrightMatcher < Minitest::Test def setup text = "Copyright 2015 Ben Balter" blob = FakeBlob.new(text) @file = Licensee::LicenseFile.new(blob) end should "match the license" do assert_equal "no-license", Licensee::CopyrightMatcher.match(@file).key end should "know the match confidence" do assert_equal 100, Licensee::CopyrightMatcher.new(@file).confidence end should "match Copyright (C) copyright notices" do text = "Copyright (C) 2015 Ben Balter" blob = FakeBlob.new(text) file = Licensee::LicenseFile.new(blob) assert_equal "no-license", Licensee::CopyrightMatcher.match(file).key end should "match Copyright © copyright notices" do text = "copyright © 2015 Ben Balter" blob = FakeBlob.new(text) file = Licensee::LicenseFile.new(blob) assert_equal "no-license", Licensee::CopyrightMatcher.match(file).key end should "not false positive" do text = File.open(Licensee::Licenses.find("mit").path).read.split("---").last blob = FakeBlob.new(text) file = Licensee::LicenseFile.new(blob) assert_equal nil, Licensee::CopyrightMatcher.match(file) end end
Version data entries
4 entries across 4 versions & 1 rubygems