summaryrefslogtreecommitdiff
path: root/spec/functional/knife
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-09-24 09:18:47 -0700
committertyler-ball <tyleraball@gmail.com>2014-10-07 16:39:56 -0700
commit1c7b4629240c49e02c482da6de1a6a2cc574304e (patch)
tree4ac2fdc415837aca9b15e6c93debda44858cbf9b /spec/functional/knife
parent1343bdfff0d54e20b923211f6697d42c484c1627 (diff)
downloadchef-1c7b4629240c49e02c482da6de1a6a2cc574304e.tar.gz
Trying to eradicate all traces of the JSON gem from Chef
Diffstat (limited to 'spec/functional/knife')
-rw-r--r--spec/functional/knife/cookbook_delete_spec.rb6
-rw-r--r--spec/functional/knife/exec_spec.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/functional/knife/cookbook_delete_spec.rb b/spec/functional/knife/cookbook_delete_spec.rb
index ee620bf165..4773fd2185 100644
--- a/spec/functional/knife/cookbook_delete_spec.rb
+++ b/spec/functional/knife/cookbook_delete_spec.rb
@@ -47,7 +47,7 @@ describe Chef::Knife::CookbookDelete do
Chef::Log.level = :debug
@knife.name_args = %w{no-such-cookbook}
- @api.get("/cookbooks/no-such-cookbook", 404, {'error'=>'dear Tim, no. -Sent from my iPad'}.to_json)
+ @api.get("/cookbooks/no-such-cookbook", 404, Chef::JSONCompat.to_json({'error'=>'dear Tim, no. -Sent from my iPad'}))
end
it "logs an error and exits" do
@@ -62,7 +62,7 @@ describe Chef::Knife::CookbookDelete do
before do
@knife.name_args = %w{obsolete-cookbook}
@cookbook_list = {'obsolete-cookbook' => { 'versions' => ['version' => '1.0.0']} }
- @api.get("/cookbooks/obsolete-cookbook", 200, @cookbook_list.to_json)
+ @api.get("/cookbooks/obsolete-cookbook", 200, Chef::JSONCompat.to_json(@cookbook_list))
end
it "asks for confirmation, then deletes the cookbook" do
@@ -105,7 +105,7 @@ describe Chef::Knife::CookbookDelete do
versions = ['1.0.0', '1.1.0', '1.2.0']
with_version = lambda { |version| { 'version' => version } }
@cookbook_list = {'obsolete-cookbook' => { 'versions' => versions.map(&with_version) } }
- @api.get("/cookbooks/obsolete-cookbook", 200, @cookbook_list.to_json)
+ @api.get("/cookbooks/obsolete-cookbook", 200, Chef::JSONCompat.to_json(@cookbook_list))
end
it "deletes all versions of a cookbook when given the '-a' flag" do
diff --git a/spec/functional/knife/exec_spec.rb b/spec/functional/knife/exec_spec.rb
index 455160fd5c..7eb52d01df 100644
--- a/spec/functional/knife/exec_spec.rb
+++ b/spec/functional/knife/exec_spec.rb
@@ -47,7 +47,7 @@ describe Chef::Knife::Exec do
@node = Chef::Node.new
@node.name("ohai-world")
response = {"rows" => [@node],"start" => 0,"total" => 1}
- @api.get(%r{^/search/node}, 200, response.to_json)
+ @api.get(%r{^/search/node}, 200, Chef::JSONCompat.to_json(response))
code = "$output.puts nodes.all"
@knife.config[:exec] = code
@knife.run