summaryrefslogtreecommitdiff
path: root/spec/support/shared/functional
diff options
context:
space:
mode:
authorAllen Goodman <allen@goodman.io>2013-12-06 10:25:44 -0500
committerAllen Goodman <allen@goodman.io>2013-12-06 10:25:44 -0500
commitee62d011a5b72473c66f95d68a2b4c82f32db5c9 (patch)
tree0686d043fb3632b06161dcd87b60f6909871cf4f /spec/support/shared/functional
parenta03cc741bccbbd31cea1f9834d5337ef69e8db0c (diff)
downloadchef-ee62d011a5b72473c66f95d68a2b4c82f32db5c9.tar.gz
fixes CHEF-4639
Diffstat (limited to 'spec/support/shared/functional')
-rw-r--r--spec/support/shared/functional/file_resource.rb25
1 files changed, 15 insertions, 10 deletions
diff --git a/spec/support/shared/functional/file_resource.rb b/spec/support/shared/functional/file_resource.rb
index e9e76c95db..b7536ce1d6 100644
--- a/spec/support/shared/functional/file_resource.rb
+++ b/spec/support/shared/functional/file_resource.rb
@@ -16,6 +16,8 @@
# limitations under the License.
#
+require 'pry'
+
shared_context "deploying with move" do
before do
Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
@@ -133,24 +135,27 @@ shared_examples_for "a file with the wrong content" do
end
- context '`.diff`’s enabled' do
+ context "`.diff`'s enabled" do
describe '.sensitive' do
- context '`.sensitive`’s insensitive by default' do
+ context "`.sensitive`'s insensitive by default" do
it { expect(resource.sensitive).to(be_false) }
end
- context '`.sensitive`’s sensitive' do
- before do
- resource.sensitive(true)
-
- resource.run_action(:create)
- end
+ context "`.sensitive`'s sensitive" do
+ before { resource.sensitive(true) }
it { expect(resource.sensitive).to(be_true) }
- it { expect(resource.diff).to(include('suppressed sensitive resource')) }
+ context '`.sensitive` suppresses a sensitive resource' do
+ subject(:provider) { resource.provider_for_action(:create) }
+
+ before { provider.run_action }
- # it { expect(resource.provider.converge_actions).to include('suppressed sensitive resource') }
+ it { expect(resource.diff).to(include('suppressed sensitive resource')) }
+
+ it { expect(provider.instance_variable_get("@converge_actions")
+ .actions[0][0]).to(eq(['suppressed sensitive resource'])) }
+ end
end
end
end