summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-26 13:46:16 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-26 13:46:16 -0800
commit11756f5f428ba0b1fc72648c7605c2ffdb364677 (patch)
treeece69e6199e9b9fc4f9d19549c486d510dc3e510 /spec
parent8d32dc4a67b03362b04e0a5eda717cb85dff9f27 (diff)
downloadchef-11756f5f428ba0b1fc72648c7605c2ffdb364677.tar.gz
suppress reporter failures by using validate_utf8=falselcg/suppress-reporter-failures
- doesn't turn off the utf8 validation in the rest of the rest API - has to use a different rest object because we have to pass options in the constructor - the handling of Chef::Config in Chef::Client is just awful
Diffstat (limited to 'spec')
-rw-r--r--spec/support/shared/context/client.rb6
-rw-r--r--spec/unit/client_spec.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/support/shared/context/client.rb b/spec/support/shared/context/client.rb
index 2089928618..3c88e36fbb 100644
--- a/spec/support/shared/context/client.rb
+++ b/spec/support/shared/context/client.rb
@@ -71,6 +71,7 @@ shared_context "a client run" do
let(:http_cookbook_sync) { double("Chef::ServerAPI (cookbook sync)") }
let(:http_node_load) { double("Chef::ServerAPI (node)") }
let(:http_node_save) { double("Chef::ServerAPI (node save)") }
+ let(:reporting_rest_client) { double("Chef::ServerAPI (reporting client)") }
let(:runner) { instance_double("Chef::Runner") }
let(:audit_runner) { instance_double("Chef::Audit::Runner", :failed? => false) }
@@ -111,6 +112,10 @@ shared_context "a client run" do
expect_any_instance_of(Chef::ResourceReporter).to receive(:node_load_completed)
end
+ def stub_rest_clean
+ allow(client).to receive(:rest_clean).and_return(reporting_rest_client)
+ end
+
def stub_for_sync_cookbooks
# --Client#setup_run_context
# ---Client#sync_cookbooks -- downloads the list of cookbooks to sync
@@ -147,6 +152,7 @@ shared_context "a client run" do
stub_const("Chef::Client::STDOUT_FD", stdout)
stub_const("Chef::Client::STDERR_FD", stderr)
+ stub_rest_clean
stub_for_register
stub_for_node_load
stub_for_sync_cookbooks
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 3b4d23da6e..c4af8c1ad9 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -2,7 +2,7 @@
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Tim Hinderliter (<tim@opscode.com>)
# Author:: Christopher Walters (<cw@opscode.com>)
-# Copyright:: Copyright 2008-2010 Opscode, Inc.
+# Copyright:: Copyright 2008-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");