summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Mills <anderson@puppetlabs.com>2014-08-28 17:28:58 -0700
committerAnderson Mills <anderson@puppetlabs.com>2014-08-28 17:28:58 -0700
commit1722e76bb385091c1a983d05a4532f203c766fe4 (patch)
tree264da8861cbc32cf1d2d21b0e6bd1d600cb16e53
parent1ab6030b57e13ba20ed9cde9830b9b27792fd5b1 (diff)
downloadpuppet-1722e76bb385091c1a983d05a4532f203c766fe4.tar.gz
PUP-3155 Improve spec tests around the PE puppet version
Before this commit, when checking the puppet version on a PE build, several characters; '(', ')' and '.'; caused problems with the regex. This commit Regexp.escape-s them.
-rwxr-xr-xspec/unit/util/command_line_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb
index bb14ce9a0..9eb61b077 100755
--- a/spec/unit/util/command_line_spec.rb
+++ b/spec/unit/util/command_line_spec.rb
@@ -70,7 +70,7 @@ describe Puppet::Util::CommandLine do
it "should print the version and exit if #{arg} is given" do
expect do
described_class.new("puppet", [arg]).execute
- end.to have_printed(/^#{Puppet.version}$/)
+ end.to have_printed(/^#{Regexp.escape(Puppet.version)}$/)
end
end
end
@@ -125,7 +125,7 @@ describe Puppet::Util::CommandLine do
expect {
commandline.execute
- }.to have_printed(/^#{Puppet.version}$/).and_exit_with(1)
+ }.to have_printed(%r[^#{Regexp.escape(Puppet.version)}$]).and_exit_with(1)
end
end
end