summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-13 12:11:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-13 12:11:45 -0700
commit92ba97d8af84822ebcda4f928cd82b001148c5b5 (patch)
treedf4de129895a2cc69abef5b121b998700cb42921 /spec
parent6d7adf9b39459541250049ae03d9e2c6abe94b90 (diff)
parent51c6ba84a3f189398b01de10d031dec5b16d9e8c (diff)
downloadchef-92ba97d8af84822ebcda4f928cd82b001148c5b5.tar.gz
Merge pull request #4034 from chef/lcg/ruby-profiling
add optional ruby-profiling with --profile-ruby
Diffstat (limited to 'spec')
-rw-r--r--spec/integration/client/client_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 5b235e2720..314a9310be 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -301,6 +301,23 @@ EOM
result.error!
end
+ it "should complete with success when using --profile-ruby and output a profile file" do
+ file 'config/client.rb', <<EOM
+local_mode true
+cookbook_path "#{path_to('cookbooks')}"
+EOM
+ result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", :cwd => chef_dir)
+ expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be true
+ end
+
+ it "doesn't produce a profile when --profile-ruby is not present" do
+ file 'config/client.rb', <<EOM
+local_mode true
+cookbook_path "#{path_to('cookbooks')}"
+EOM
+ result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir)
+ expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be false
+ end
end
when_the_repository "has a cookbook that generates deprecation warnings" do