summaryrefslogtreecommitdiff
path: root/spec/integration/knife
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2013-01-19 14:52:27 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:23 -0700
commitc50262a4f63e0f81a16926d4544905d0764c8fc6 (patch)
tree3449c6ed8cdb8c1fba19b228e0d95638b50ef7fc /spec/integration/knife
parent72fc14863ad112b8152b8836a94a985d30304bc0 (diff)
downloadchef-c50262a4f63e0f81a16926d4544905d0764c8fc6.tar.gz
Protect against bad JSON on the client
Diffstat (limited to 'spec/integration/knife')
-rw-r--r--spec/integration/knife/diff_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb
index 921a43ead2..60c4a24731 100644
--- a/spec/integration/knife/diff_spec.rb
+++ b/spec/integration/knife/diff_spec.rb
@@ -278,4 +278,14 @@ EOM
end
end
end
+
+ when_the_chef_server 'has an environment' do
+ environment 'x', {}
+ when_the_repository 'has an environment with bad JSON' do
+ file 'environments/x.json', '{'
+ it 'knife diff reports a warning and does a textual diff' do
+ knife('diff /environments/x.json').should_succeed(/- "name": "x"/, :stderr => "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: A JSON text must at least contain two octets!\n")
+ end
+ end
+ end
end