From 1009aa02b31d7c5c550d534d03e3ef92034fb8aa Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Tue, 1 Nov 2016 12:09:14 -0700 Subject: [PATCH 1/3] Switch from node.set to node.default in spec tests `node.set` is deprecated --- test/unit/spec/gem_spec.rb | 4 ++-- test/unit/spec/spec_helper.rb | 2 +- test/unit/spec/webhook_spec.rb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/spec/gem_spec.rb b/test/unit/spec/gem_spec.rb index 2cb7cc9..e935d85 100644 --- a/test/unit/spec/gem_spec.rb +++ b/test/unit/spec/gem_spec.rb @@ -12,8 +12,8 @@ node_resources(node) # data for this node stub_chef_zero(platform, version, server) # stub other nodes in chef-zero - node.set['chef_client']['handler']['slack']['team'] = 'foo' - node.set['chef_client']['handler']['slack']['api_key'] = 'bar' + node.default['chef_client']['handler']['slack']['team'] = 'foo' + node.default['chef_client']['handler']['slack']['api_key'] = 'bar' end.converge(described_recipe) end diff --git a/test/unit/spec/spec_helper.rb b/test/unit/spec/spec_helper.rb index 06f79eb..bbdca2c 100644 --- a/test/unit/spec/spec_helper.rb +++ b/test/unit/spec/spec_helper.rb @@ -12,7 +12,7 @@ log_level: ::LOG_LEVEL }.freeze -# use node.default or node.set to put stub data for every node in every test +# use node.default to put stub data for every node in every test # could also use this method to stub other node-related things like environment def node_resources(node) # Stub the node and any calls to Environment.Load to return this environment diff --git a/test/unit/spec/webhook_spec.rb b/test/unit/spec/webhook_spec.rb index ff2bb54..3cf652e 100644 --- a/test/unit/spec/webhook_spec.rb +++ b/test/unit/spec/webhook_spec.rb @@ -12,10 +12,10 @@ node_resources(node) # data for this node stub_chef_zero(platform, version, server) # stub other nodes in chef-zero - node.set['chef_client']['handler']['slack']['team'] = 'foo' - node.set['chef_client']['handler']['slack']['api_key'] = 'bar' - node.set['chef_client']['handler']['slack']['webhooks']['name'] = ['bar'] - node.set['chef_client']['handler']['slack']['webhooks']['test']['url'] = 'https://hooks.slack.local/1/2/3' + node.default['chef_client']['handler']['slack']['team'] = 'foo' + node.default['chef_client']['handler']['slack']['api_key'] = 'bar' + node.default['chef_client']['handler']['slack']['webhooks']['name'] = ['bar'] + node.default['chef_client']['handler']['slack']['webhooks']['test']['url'] = 'https://hooks.slack.local/1/2/3' end.converge(described_recipe) end From 2a12a0a85e416a7e68a5ecfcd35f194e9ada39c3 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Tue, 1 Nov 2016 12:17:06 -0700 Subject: [PATCH 2/3] Remove unused code in spec_helper LOG_LEVEL was shadowing a defination in the chef core code and was not being used here anyway `.bundle/ruby/2.3.0/gems/chef-12.5.1/lib/chef/config.rb:38` --- test/unit/spec/spec_helper.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/unit/spec/spec_helper.rb b/test/unit/spec/spec_helper.rb index bbdca2c..a91bcbd 100644 --- a/test/unit/spec/spec_helper.rb +++ b/test/unit/spec/spec_helper.rb @@ -7,11 +7,6 @@ Dir['./test/unit/spec/support/**/*.rb'].sort.each { |f| require f } -::LOG_LEVEL = :fatal -::CHEFSPEC_OPTS = { - log_level: ::LOG_LEVEL -}.freeze - # use node.default to put stub data for every node in every test # could also use this method to stub other node-related things like environment def node_resources(node) From c89bc0d35bf2b35fe6ce3a3df0df07e3a14d41fb Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Tue, 1 Nov 2016 13:31:13 -0700 Subject: [PATCH 3/3] Add Ubuntu 16.04 to kitchen --- .kitchen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.kitchen.yml b/.kitchen.yml index 39291f4..175b0a9 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -15,6 +15,7 @@ platforms: - name: fedora-22 - name: ubuntu-12.04 - name: ubuntu-14.04 + - name: ubuntu-16.04 suites: