1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

Test each license file does not begin with byte order mark

Fixes #328
This commit is contained in:
Mike Linksvayer 2016-01-28 17:19:42 -08:00
parent 45c02a892c
commit 6854e8aa86

16
spec/license_bom_spec.rb Normal file
View File

@ -0,0 +1,16 @@
require 'spec_helper'
describe "license file" do
bom = "\xEF\xBB\xBF".each_byte.to_a
files = Dir["_licenses/*.txt"]
files.each do |fn|
first3 = File.open(fn) {|f| f.read(3)}
it "#{fn} should not have a byte order mark" do
expect(first3.each_byte.to_a).not_to eq(bom)
end
end
end