1
0
mirror of https://github.com/github/choosealicense.com synced 2024-06-09 12:47:49 +02:00
choosealicense.com/spec/license_bom_spec.rb

16 lines
482 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2017-03-27 02:19:44 +02:00
require 'spec_helper'
2016-02-08 21:37:19 +01:00
describe 'byte order marks' do
Dir["#{licenses_path}/*.txt"].each do |file|
context "the #{File.basename(file, '.txt')} license" do
2016-02-08 21:37:19 +01:00
it 'does not begin with a byte order mark' do
2022-01-06 02:50:10 +01:00
bom = File.read(file).start_with?("\u0000EF\u0000BB\u0000BF")
msg = 'License file begins with a Byte Order Mark. See https://stackoverflow.com/a/1068700.'
2016-01-29 18:44:28 +01:00
expect(bom).to eql(false), msg
end
end
end
end