summaryrefslogtreecommitdiff
path: root/spec/unit/knife_spec.rb
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-05-01 15:35:29 -0700
committertylercloke <tylercloke@gmail.com>2015-05-04 13:18:30 -0700
commita93fc69d0c09a9e8fc5f5cdac865d91db4ea012f (patch)
treef47e12f4222c380f681bffc8ef569e6e8278cf18 /spec/unit/knife_spec.rb
parent2160fb4f917fb9f843c2bbd11093cbb1c2873482 (diff)
downloadchef-a93fc69d0c09a9e8fc5f5cdac865d91db4ea012f.tar.gz
Nice error handling for unsupported API version in formatters/*.rb.
Diffstat (limited to 'spec/unit/knife_spec.rb')
-rw-r--r--spec/unit/knife_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index a0afafb6b9..7cb16aae2a 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -381,8 +381,8 @@ describe Chef::Knife do
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "sad trombone", :min_version => "0", :max_version => "1"))
allow(knife).to receive(:run).and_raise(Net::HTTPServerException.new("406 Not Acceptable", response))
knife.run_with_pretty_exceptions
- expect(stderr.string).to match(%r[The version of Chef that Knife is using is not supported by the Chef server you sent this request to])
- expect(stderr.string).to match(%r[This version of Chef requires a server API version of #{Chef::HTTP::Authenticator::SERVER_API_VERSION}])
+ expect(stderr.string).to include('The version of Chef that Knife is using is not supported by the Chef server you sent this request to')
+ expect(stderr.string).to include("This version of Chef requires a server API version of #{Chef::HTTP::Authenticator::SERVER_API_VERSION}")
end
it "formats 500s nicely" do