summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-03-16 19:10:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-03-17 09:05:14 -0700
commit202d186bc38b38d119497e0d013767882655fdd8 (patch)
treed2b4064246aedcaaff8c98ecc2e79691300f2577
parent0dfb6b354bf7d81dadc3cdfdee343272cb52009f (diff)
downloadchef-202d186bc38b38d119497e0d013767882655fdd8.tar.gz
fix specs broken by removal of state method
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/resource/cookbook_file_spec.rb4
-rw-r--r--spec/unit/resource/cron_spec.rb2
-rw-r--r--spec/unit/resource/deploy_spec.rb2
-rw-r--r--spec/unit/resource/directory_spec.rb4
-rw-r--r--spec/unit/resource/env_spec.rb2
-rw-r--r--spec/unit/resource/file_spec.rb4
-rw-r--r--spec/unit/resource/group_spec.rb4
-rw-r--r--spec/unit/resource/ifconfig_spec.rb2
-rw-r--r--spec/unit/resource/link_spec.rb4
-rw-r--r--spec/unit/resource/mdadm_spec.rb2
-rw-r--r--spec/unit/resource/mount_spec.rb6
-rw-r--r--spec/unit/resource/ohai_spec.rb2
-rw-r--r--spec/unit/resource/package_spec.rb4
-rw-r--r--spec/unit/resource/registry_key_spec.rb4
-rw-r--r--spec/unit/resource/remote_directory_spec.rb4
-rw-r--r--spec/unit/resource/remote_file_spec.rb4
-rw-r--r--spec/unit/resource/route_spec.rb2
-rw-r--r--spec/unit/resource/scm_spec.rb4
-rw-r--r--spec/unit/resource/service_spec.rb2
-rw-r--r--spec/unit/resource/systemd_unit_spec.rb2
-rw-r--r--spec/unit/resource/template_spec.rb4
-rw-r--r--spec/unit/resource/user_spec.rb2
-rw-r--r--spec/unit/resource_reporter_spec.rb10
-rw-r--r--spec/unit/resource_spec.rb2
24 files changed, 41 insertions, 41 deletions
diff --git a/spec/unit/resource/cookbook_file_spec.rb b/spec/unit/resource/cookbook_file_spec.rb
index 6886ce1f31..05c37446a6 100644
--- a/spec/unit/resource/cookbook_file_spec.rb
+++ b/spec/unit/resource/cookbook_file_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2010-2016, Chef Software, Inc.
+# Copyright:: Copyright 2010-2017, Chef Software Inc.
#p License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -64,7 +64,7 @@ describe Chef::Resource::CookbookFile do
end
it "describes the state" do
- state = @cookbook_file.state
+ state = @cookbook_file.state_for_resource_reporter
if Chef::Platform.windows?
puts state
expect(state[:rights]).to eq([{ :permissions => :read, :principals => "Everyone" }])
diff --git a/spec/unit/resource/cron_spec.rb b/spec/unit/resource/cron_spec.rb
index 6e867b75e1..e2bfc321e8 100644
--- a/spec/unit/resource/cron_spec.rb
+++ b/spec/unit/resource/cron_spec.rb
@@ -170,7 +170,7 @@ describe Chef::Resource::Cron do
end
it "describes the state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:minute]).to eq("1")
expect(state[:hour]).to eq("2")
expect(state[:day]).to eq("3")
diff --git a/spec/unit/resource/deploy_spec.rb b/spec/unit/resource/deploy_spec.rb
index a758638244..e008d79c29 100644
--- a/spec/unit/resource/deploy_spec.rb
+++ b/spec/unit/resource/deploy_spec.rb
@@ -270,7 +270,7 @@ describe Chef::Resource::Deploy do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:deploy_to]).to eq("/")
expect(state[:revision]).to eq("1.2.3")
end
diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb
index cfb3ade135..b3a0134024 100644
--- a/spec/unit/resource/directory_spec.rb
+++ b/spec/unit/resource/directory_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,7 +69,7 @@ describe Chef::Resource::Directory do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:group]).to eq("wheel")
expect(state[:mode]).to eq("0664")
expect(state[:owner]).to eq("root")
diff --git a/spec/unit/resource/env_spec.rb b/spec/unit/resource/env_spec.rb
index cff862b69e..1c63ab519f 100644
--- a/spec/unit/resource/env_spec.rb
+++ b/spec/unit/resource/env_spec.rb
@@ -73,7 +73,7 @@ describe Chef::Resource::Env do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:value]).to eq("level7")
end
diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb
index 19304cb6b8..403c847a45 100644
--- a/spec/unit/resource/file_spec.rb
+++ b/spec/unit/resource/file_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -101,7 +101,7 @@ describe Chef::Resource::File do
context "on unix", :unix_only do
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:owner]).to eq("root")
expect(state[:group]).to eq("wheel")
expect(state[:mode]).to eq("0644")
diff --git a/spec/unit/resource/group_spec.rb b/spec/unit/resource/group_spec.rb
index 9d9b5c1111..8772f37a2b 100644
--- a/spec/unit/resource/group_spec.rb
+++ b/spec/unit/resource/group_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: AJ Christensen (<aj@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>);
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -151,7 +151,7 @@ describe Chef::Resource::Group, "append" do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:members]).to eql(%w{blastoise pikachu})
end
diff --git a/spec/unit/resource/ifconfig_spec.rb b/spec/unit/resource/ifconfig_spec.rb
index eceba0c319..699ebf1233 100644
--- a/spec/unit/resource/ifconfig_spec.rb
+++ b/spec/unit/resource/ifconfig_spec.rb
@@ -37,7 +37,7 @@ describe Chef::Resource::Ifconfig do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:inet_addr]).to eq("434.2343.23")
expect(state[:mask]).to eq("255.255.545")
end
diff --git a/spec/unit/resource/link_spec.rb b/spec/unit/resource/link_spec.rb
index bd0976d8ea..adfd0020f5 100644
--- a/spec/unit/resource/link_spec.rb
+++ b/spec/unit/resource/link_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -121,7 +121,7 @@ describe Chef::Resource::Link do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:to]).to eq("/to/dir/file.tar")
expect(state[:owner]).to eq("root")
expect(state[:group]).to eq("0664")
diff --git a/spec/unit/resource/mdadm_spec.rb b/spec/unit/resource/mdadm_spec.rb
index fe9acf807b..f3cadbe499 100644
--- a/spec/unit/resource/mdadm_spec.rb
+++ b/spec/unit/resource/mdadm_spec.rb
@@ -93,7 +93,7 @@ describe Chef::Resource::Mdadm do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:devices]).to eql(%w{device1 device2})
expect(state[:level]).to eq(1)
expect(state[:chunk]).to eq(42)
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index 832f7644ac..466b6ac8c0 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Joshua Timberman (<joshua@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2009-2016, Chef Software Inc.
+# Copyright:: Copyright 2009-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -181,7 +181,7 @@ describe Chef::Resource::Mount do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:mount_point]).to eq("123.456")
expect(state[:device_type]).to eql(:device)
expect(state[:fstype]).to eq("ranked")
@@ -202,7 +202,7 @@ describe Chef::Resource::Mount do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:mount_point]).to eq("T:")
expect(state[:username]).to eq("Administrator")
expect(state[:password]).to eq("Jetstream123!")
diff --git a/spec/unit/resource/ohai_spec.rb b/spec/unit/resource/ohai_spec.rb
index cf1748002b..574c09eeba 100644
--- a/spec/unit/resource/ohai_spec.rb
+++ b/spec/unit/resource/ohai_spec.rb
@@ -49,7 +49,7 @@ describe Chef::Resource::Ohai do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:plugin]).to eq("passwd")
end
diff --git a/spec/unit/resource/package_spec.rb b/spec/unit/resource/package_spec.rb
index 7ec3c198e4..8c00ea2bdd 100644
--- a/spec/unit/resource/package_spec.rb
+++ b/spec/unit/resource/package_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -72,7 +72,7 @@ describe Chef::Resource::Package do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:version]).to eq("10.9.8")
expect(state[:options]).to eq("-al")
end
diff --git a/spec/unit/resource/registry_key_spec.rb b/spec/unit/resource/registry_key_spec.rb
index d378da3ed0..067f2da36a 100644
--- a/spec/unit/resource/registry_key_spec.rb
+++ b/spec/unit/resource/registry_key_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Lamont Granquist (<lamont@chef.io>)
-# Copyright:: Copyright 2012-2016, Chef Software Inc.
+# Copyright:: Copyright 2012-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -210,6 +210,6 @@ describe Chef::Resource::RegistryKey, "state" do
it "should return scrubbed values" do
@resource.values([ { :name => "poosh", :type => :binary, :data => 255.chr * 1 } ])
- expect(@resource.state).to eql( { :values => [{ :name => "poosh", :type => :binary, :data => "a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89" }] } )
+ expect(@resource.state_for_resource_reporter).to eql( { :values => [{ :name => "poosh", :type => :binary, :data => "a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89" }] } )
end
end
diff --git a/spec/unit/resource/remote_directory_spec.rb b/spec/unit/resource/remote_directory_spec.rb
index cdca214db6..370b8d8225 100644
--- a/spec/unit/resource/remote_directory_spec.rb
+++ b/spec/unit/resource/remote_directory_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,7 +84,7 @@ describe Chef::Resource::RemoteDirectory do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:files_owner]).to eq("root")
expect(state[:files_group]).to eq("supergroup")
expect(state[:files_mode]).to eq("0664")
diff --git a/spec/unit/resource/remote_file_spec.rb b/spec/unit/resource/remote_file_spec.rb
index 274f98e7f4..eca3db3420 100644
--- a/spec/unit/resource/remote_file_spec.rb
+++ b/spec/unit/resource/remote_file_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -183,7 +183,7 @@ describe Chef::Resource::RemoteFile do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
if Chef::Platform.windows?
puts state
expect(state[:rights]).to eq([{ :permissions => :read, :principals => "Everyone" }])
diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb
index 259ccf7eab..884b477365 100644
--- a/spec/unit/resource/route_spec.rb
+++ b/spec/unit/resource/route_spec.rb
@@ -95,7 +95,7 @@ describe Chef::Resource::Route do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:netmask]).to eq("lemask")
expect(state[:gateway]).to eq("111.111.111")
end
diff --git a/spec/unit/resource/scm_spec.rb b/spec/unit/resource/scm_spec.rb
index f39334348e..679b3bc1fc 100644
--- a/spec/unit/resource/scm_spec.rb
+++ b/spec/unit/resource/scm_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Daniel DeLeo (<dan@kallistec.com>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -174,7 +174,7 @@ describe Chef::Resource::Scm do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:revision]).to eq("1.2.3")
end
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb
index 8d661e2a7a..205282b99f 100644
--- a/spec/unit/resource/service_spec.rb
+++ b/spec/unit/resource/service_spec.rb
@@ -166,7 +166,7 @@ describe Chef::Resource::Service do
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:enabled]).to eql(true)
expect(state[:running]).to eql(false)
end
diff --git a/spec/unit/resource/systemd_unit_spec.rb b/spec/unit/resource/systemd_unit_spec.rb
index 7e46872525..ab1004fab0 100644
--- a/spec/unit/resource/systemd_unit_spec.rb
+++ b/spec/unit/resource/systemd_unit_spec.rb
@@ -109,7 +109,7 @@ describe Chef::Resource::SystemdUnit do
@resource.masked false
@resource.static false
@resource.content "test"
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:active]).to eq(true)
expect(state[:enabled]).to eq(true)
expect(state[:masked]).to eq(false)
diff --git a/spec/unit/resource/template_spec.rb b/spec/unit/resource/template_spec.rb
index 9060f02d29..966a86ba6b 100644
--- a/spec/unit/resource/template_spec.rb
+++ b/spec/unit/resource/template_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -88,7 +88,7 @@ describe Chef::Resource::Template do
context "on unix", :unix_only do
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:owner]).to eq("root")
expect(state[:group]).to eq("wheel")
expect(state[:mode]).to eq("0644")
diff --git a/spec/unit/resource/user_spec.rb b/spec/unit/resource/user_spec.rb
index afd3969164..1a3f0284e3 100644
--- a/spec/unit/resource/user_spec.rb
+++ b/spec/unit/resource/user_spec.rb
@@ -119,7 +119,7 @@ end
end
it "describes its state" do
- state = @resource.state
+ state = @resource.state_for_resource_reporter
expect(state[:uid]).to eq(123)
expect(state[:gid]).to eq(456)
expect(state[:home]).to eq("/usr/local/root/")
diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb
index 84cfb52418..4fcfb01233 100644
--- a/spec/unit/resource_reporter_spec.rb
+++ b/spec/unit/resource_reporter_spec.rb
@@ -3,7 +3,7 @@
# Author:: Prajakta Purohit (<prajakta@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
#
-# Copyright:: Copyright 2012-2016, Chef Software Inc.
+# Copyright:: Copyright 2012-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -399,11 +399,11 @@ describe Chef::ResourceReporter do
end
it "includes an updated resource's initial state" do
- expect(@first_update_report["before"]).to eq(current_resource.state)
+ expect(@first_update_report["before"]).to eq(current_resource.state_for_resource_reporter)
end
it "includes an updated resource's final state" do
- expect(@first_update_report["after"]).to eq(new_resource.state)
+ expect(@first_update_report["after"]).to eq(new_resource.state_for_resource_reporter)
end
it "includes the resource's name" do
@@ -540,11 +540,11 @@ describe Chef::ResourceReporter do
end
it "includes an updated resource's initial state" do
- expect(@first_update_report["before"]).to eq(@current_resource.state)
+ expect(@first_update_report["before"]).to eq(@current_resource.state_for_resource_reporter)
end
it "includes an updated resource's final state" do
- expect(@first_update_report["after"]).to eq(@new_resource.state)
+ expect(@first_update_report["after"]).to eq(@new_resource.state_for_resource_reporter)
end
it "includes the resource's name" do
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index c1aeb256fa..11289a41c6 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -160,7 +160,7 @@ describe Chef::Resource do
end
it "describes its state" do
- resource_state = file_resource.state
+ resource_state = file_resource.state_for_resource_reporter
expect(resource_state.keys).to match_array([:checksum, :owner, :group, :mode])
expect(resource_state[:checksum]).to eq("abc123")
expect(resource_state[:owner]).to eq("root")