Skip to content

Commit

Permalink
Define matchers for ChefSpec
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Oct 8, 2016
1 parent 32ded8a commit a02b5d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[List any existing issues this PR resolves]

### Check List
- [ ] All tests pass. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD

- [ ] All tests pass. See <https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD>
- [ ] New functionality includes testing.
- [ ] New functionality has been documented in the README if applicable
- [ ] The CLA has been signed. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

- [ ] All commits have been signed for the Developer Certificate of Origin. See <https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD>
6 changes: 6 additions & 0 deletions libraries/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# apt_preference
#################

ChefSpec.define_matcher :apt_preference

def add_apt_preference(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:apt_preference, :add, resource_name)
end
Expand All @@ -16,6 +18,8 @@ def remove_apt_preference(resource_name)
# apt_repository
#################

ChefSpec.define_matcher :apt_repository

def add_apt_repository(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:apt_repository, :add, resource_name)
end
Expand All @@ -28,6 +32,8 @@ def remove_apt_repository(resource_name)
# apt_update
#################

ChefSpec.define_matcher :apt_update

def update_apt_update(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:apt_update, :update, resource_name)
end
Expand Down

0 comments on commit a02b5d8

Please sign in to comment.