diff options
author | Marc Chamberland <mchamberland@pbsc.com> | 2019-04-06 19:16:22 -0400 |
---|---|---|
committer | Marc Chamberland <mchamberland@pbsc.com> | 2019-04-19 19:02:35 -0400 |
commit | 33d1f9e3ad1013387a3b3a53d6969c905942b692 (patch) | |
tree | ff8ed416f691478e046a65210040311a6608d985 /spec | |
parent | f1a97f33d4b67645ed55ce6e15274d6adf396670 (diff) | |
download | chef-33d1f9e3ad1013387a3b3a53d6969c905942b692.tar.gz |
Replacing workmarks with distro constants
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/version_spec.rb | 2 | ||||
-rw-r--r-- | spec/integration/solo/solo_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/application/client_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/knife_spec.rb | 20 |
4 files changed, 15 insertions, 15 deletions
diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb index dc323e9d3a..90a0aa19f6 100644 --- a/spec/functional/version_spec.rb +++ b/spec/functional/version_spec.rb @@ -28,7 +28,7 @@ describe "Chef Versions" do binaries.each do |binary| it "#{binary} version should be sane" do - expect(shell_out!("ruby #{File.join("bin", binary)} -v", cwd: chef_dir).stdout.chomp).to include("Chef: #{Chef::VERSION}") + expect(shell_out!("ruby #{File.join("bin", binary)} -v", cwd: chef_dir).stdout.chomp).to include("#{Chef::Dist::PRODUCT}: #{Chef::VERSION}") end end diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 12826eb586..76304cc334 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -163,7 +163,7 @@ describe "chef-solo" do ruby_block "sleeping" do block do retries = 200 - while IO.read(Chef::Config[:log_location]) !~ /Chef client .* is running, will wait for it to finish and then run./ + while IO.read(Chef::Config[:log_location]) !~ /#{Chef::Dist::PRODUCT} client .* is running, will wait for it to finish and then run./ sleep 0.1 raise "we ran out of retries" if ( retries -= 1 ) <= 0 end @@ -207,10 +207,10 @@ describe "chef-solo" do run_log = File.read(path_to("logs/runs.log")) # second run should have a message which indicates it's waiting for the first run - expect(run_log).to match(/Chef client .* is running, will wait for it to finish and then run./) + expect(run_log).to match(/#{Chef::Dist::PRODUCT} client .* is running, will wait for it to finish and then run./) # both of the runs should succeed - expect(run_log.lines.reject { |l| !l.include? "INFO: Chef Run complete in" }.length).to eq(2) + expect(run_log.lines.reject { |l| !l.include? "INFO: #{Chef::Dist::PRODUCT} Run complete in" }.length).to eq(2) end end diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index f971848c5b..6af3a31cd1 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -226,7 +226,7 @@ describe Chef::Application::Client, "reconfigure" do context "local mode not set" do it "fails with a message stating local mode required" do - expect(Chef::Application).to receive(:fatal!).with("chef-client recipe-url can be used only in local-mode").and_raise("error occured") + expect(Chef::Application).to receive(:fatal!).with("recipe-url can be used only in local-mode").and_raise("error occured") ARGV.replace(["--recipe-url=test_url"]) expect { app.reconfigure }.to raise_error "error occured" end diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index d727501b60..d6d1e7758c 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -458,7 +458,7 @@ describe Chef::Knife do allow(knife).to receive(:username).and_return("sadpanda") knife.run_with_pretty_exceptions expect(stderr.string).to match(%r{ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action}) - expect(stderr.string).to match(%r{ERROR: There are proxy servers configured, your Chef server may need to be added to NO_PROXY.}) + expect(stderr.string).to match(%r{ERROR: There are proxy servers configured, your #{Chef::Dist::PRODUCT} server may need to be added to NO_PROXY.}) expect(stderr.string).to match(%r{Response: y u no administrator}) end end @@ -494,9 +494,9 @@ describe Chef::Knife do allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("406 Not Acceptable", response)) knife.run_with_pretty_exceptions - expect(stderr.string).to include("The request that Knife sent was using API version 10000000") - expect(stderr.string).to include("The Chef server you sent the request to supports a min API verson of 0 and a max API version of 1") - expect(stderr.string).to include("Please either update your Chef client or server to be a compatible set") + expect(stderr.string).to include("The request that #{Chef::Dist::KNIFE} sent was using API version 10000000") + expect(stderr.string).to include("The #{Chef::Dist::PRODUCT} server you sent the request to supports a min API verson of 0 and a max API version of 1") + expect(stderr.string).to include("Please either update your #{Chef::Dist::PRODUCT} client or server to be a compatible set") end it "formats 500s nicely" do @@ -542,8 +542,8 @@ describe Chef::Knife do it "formats NameError and NoMethodError nicely" do allow(knife).to receive(:run).and_raise(NameError.new("Undefined constant FUUU")) knife.run_with_pretty_exceptions - expect(stderr.string).to match(%r{ERROR: knife encountered an unexpected error}) - expect(stderr.string).to match(%r{This may be a bug in the 'knife' knife command or plugin}) + expect(stderr.string).to match(%r{ERROR: #{Chef::Dist::KNIFE} encountered an unexpected error}) + expect(stderr.string).to match(%r{This may be a bug in the 'knife' #{Chef::Dist::KNIFE} command or plugin}) expect(stderr.string).to match(%r{Exception: NameError: Undefined constant FUUU}) end @@ -562,7 +562,7 @@ describe Chef::Knife do # *nix = Errno::ECONNREFUSED: Connection refused # win32: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. expect(stderr.string).to match(%r{ERROR: Network Error: .* - y u no shut up}) - expect(stderr.string).to match(%r{Check your knife configuration and network settings}) + expect(stderr.string).to match(%r{Check your #{Chef::Dist::KNIFE} configuration and network settings}) end it "formats SSL errors nicely and suggests to use `knife ssl check` and `knife ssl fetch`" do @@ -573,9 +573,9 @@ describe Chef::Knife do expected_message = <<~MSG ERROR: Could not establish a secure connection to the server. - Use `knife ssl check` to troubleshoot your SSL configuration. - If your Chef Server uses a self-signed certificate, you can use - `knife ssl fetch` to make knife trust the server's certificates. + Use `#{Chef::Dist::KNIFE} ssl check` to troubleshoot your SSL configuration. + If your #{Chef::Dist::PRODUCT} Server uses a self-signed certificate, you can use + `#{Chef::Dist::KNIFE} ssl fetch` to make #{Chef::Dist::KNIFE} trust the server's certificates. MSG expect(stderr.string).to include(expected_message) end |