1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-05 19:28:50 +01:00

add test that this project's license detected as MIT

This commit is contained in:
Mike Linksvayer 2017-12-30 15:38:31 -08:00
parent 8cac9c3d8e
commit 2459e4ff99
3 changed files with 23 additions and 12 deletions

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true
require 'licensee'
require 'spec_helper'
describe 'license meta' do
@ -49,17 +48,6 @@ describe 'license meta' do
end
context 'licensee detects using examples' do
module Licensee
class License
class << self
def license_dir
dir = ::File.dirname(__FILE__)
::File.expand_path '../_licenses', dir
end
end
end
end
slug = license['slug']
examples.each do |example|

11
spec/self_license_spec.rb Normal file
View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
require 'spec_helper'
context 'licensee detects this project' do
let(:detected) { Licensee::project('.').license }
it "license as MIT" do
expect(detected.key).to eq('mit')
end
end

View File

@ -2,6 +2,7 @@
require 'jekyll'
require 'json'
require 'licensee'
require 'open-uri'
require 'nokogiri'
@ -138,3 +139,14 @@ end
def approved_licenses
(osi_approved_licenses.keys + fsf_approved_licenses.keys + od_approved_licenses.keys).flatten.uniq.sort
end
module Licensee
class License
class << self
def license_dir
dir = ::File.dirname(__FILE__)
::File.expand_path '../_licenses', dir
end
end
end
end