Skip to content

Commit

Permalink
adding matcher for cookbook tests (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdwilhelm authored Mar 3, 2017
1 parent e3b01e6 commit 07f504f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ machine_tag Cookbook CHANGELOG

This file is used to list changes made in each version of the machine_tag cookbook.

v2.0.3
------
- adding a matcher for cookbook test

v2.0.2
------
- adding in support for chef 12.18
Expand Down
28 changes: 28 additions & 0 deletions libraries/matcher.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Cookbook Name:: machine_tag
# Library:: matchers
#
# Copyright (C) 2017 RightScale, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

if defined?(ChefSpec)
def create_machine_tag(resource_name)
ChefSpec::Matchers::ResourceMatcher.new('machine_tag', :create, resource_name)
end

def delete_machine_tag(resource_name)
ChefSpec::Matchers::ResourceMatcher.new('machine_tag', :delete, resource_name)
end
end
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs/Configures machine_tag'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.0.2'
version '2.0.3'
issues_url 'https://github.com/rightscale-cookbooks/machine_tag/issues' if respond_to?(:issues_url)
source_url 'https://github.com/rightscale-cookbooks/machine_tag' if respond_to?(:source_url)
chef_version '>= 12.0' if respond_to?(:chef_version)
Expand Down

0 comments on commit 07f504f

Please sign in to comment.