spec/licensee/content_helper_spec.rb in licensee-8.8.5 vs spec/licensee/content_helper_spec.rb in licensee-8.9.0
- old
+ new
@@ -7,25 +7,26 @@
end
end
RSpec.describe Licensee::ContentHelper do
let(:content) do
- <<-EOS.freeze
-The MIT License
+ <<-EOS.freeze.gsub(/^\s*/, '')
+ # The MIT License
+ =================
-Copyright 2016 Ben Balter
+ Copyright 2016 Ben Balter
-The made
-up license.
------------
+ The made
+ up license.
+ -----------
EOS
end
subject { ContentHelperTestHelper.new(content) }
let(:mit) { Licensee::License.find('mit') }
it 'creates the wordset' do
- expect(subject.wordset).to eql(Set.new(%w(the made up license)))
+ expect(subject.wordset).to eql(Set.new(%w[the made up license]))
end
it 'knows the length' do
expect(subject.length).to eql(20)
end
@@ -69,9 +70,13 @@
expect(normalized_content).to_not match ' '
end
it 'strips whitespace' do
expect(normalized_content).to_not match(/\n/)
+ end
+
+ it 'strips markdown headings' do
+ expect(normalized_content).to_not match('#')
end
Licensee::License.all(hidden: true).each do |license|
context license.name do
let(:stripped_content) { subject.content_without_title_and_version }