Skip to content

Commit 5dcda19

Browse files
committed
Add space to URI error
The URI gem recently updated its error messages to include a space where there previously was not one: ruby/uri@9f2c7ed This commit updates our test to reflect that change. (cherry picked from commit c3a5090)
1 parent 40ede6b commit 5dcda19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/unit/provider/package/puppetserver_gem_spec.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@
7777

7878
it "raises if given an invalid URI" do
7979
resource[:source] = 'h;ttp://rubygems.com'
80-
expect { provider.install }.to raise_error(Puppet::Error, /Invalid source '': bad URI\(is not URI\?\)/)
80+
# Older versions of URI don't have a space before the opening
81+
# parenthesis in the error message, newer versions do
82+
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('3.0.0')
83+
expect { provider.install }.to raise_error(Puppet::Error, /Invalid source '': bad URI\(is not URI\?\)/)
84+
else
85+
expect { provider.install }.to raise_error(Puppet::Error, /Invalid source '': bad URI \(is not URI\?\)/)
86+
end
8187
end
8288
end
8389
end

0 commit comments

Comments
 (0)