Skip to content

Commit

Permalink
Merge pull request rackspace-cookbooks#40 from shortdudey123/cleanup
Browse files Browse the repository at this point in the history
Testing Cleanup
  • Loading branch information
martinb3 authored Nov 2, 2016
2 parents fc2da54 + c89bc0d commit be6d96a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ platforms:
- name: fedora-22
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-16.04


suites:
Expand Down
4 changes: 2 additions & 2 deletions test/unit/spec/gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions test/unit/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

Dir['./test/unit/spec/support/**/*.rb'].sort.each { |f| require f }

::LOG_LEVEL = :fatal
::CHEFSPEC_OPTS = {
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
Expand Down
8 changes: 4 additions & 4 deletions test/unit/spec/webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit be6d96a

Please sign in to comment.