spec/licensee/license_spec.rb in licensee-9.14.1 vs spec/licensee/license_spec.rb in licensee-9.15.0
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
RSpec.describe Licensee::License do
- let(:license_count) { 41 }
- let(:hidden_license_count) { 28 }
+ let(:license_count) { 42 }
+ let(:hidden_license_count) { 29 }
let(:featured_license_count) { 3 }
let(:pseudo_license_count) { 2 }
let(:non_featured_license_count) do
license_count - featured_license_count - hidden_license_count
end
@@ -381,11 +381,11 @@
it 'finds by title' do
expect(described_class.find_by_title(text)).to eql(license)
end
- if license.title =~ /\bGNU\b/
+ if /\bGNU\b/.match?(license.title)
context "without 'GNU'" do
let(:text) { license_variation.sub(/GNU /i, '') }
it 'still matches' do
expect(text).to match(license.title_regex)
@@ -488,18 +488,18 @@
before { source.scheme = scheme }
prefixes.each do |prefix|
context "with '#{prefix}' before the host" do
before do
- source.host = "#{prefix}#{source.host.sub(/\Awww\./, '')}"
+ source.host = "#{prefix}#{source.host.delete_prefix('www.')}"
end
suffixes.each do |suffix|
context "with '#{suffix}' after the path" do
before do
next if license.key == 'wtfpl'
- regex = /#{Licensee::License::SOURCE_SUFFIX}\z/
+ regex = /#{Licensee::License::SOURCE_SUFFIX}\z/o
source.path = source.path.sub(regex, '')
source.path = "#{source.path}#{suffix}"
end
it 'matches' do