Skip to content

Commit

Permalink
Merge pull request #213 from chef-cookbooks/matchers
Browse files Browse the repository at this point in the history
Depend on the latest compat_resource and add matchers
  • Loading branch information
tas50 authored Oct 14, 2016
2 parents e5f58a6 + a02b5d8 commit 0007dca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 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
5 changes: 2 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

source_url 'https://github.com/chef-cookbooks/apt'
issues_url 'https://github.com/chef-cookbooks/apt/issues'
chef_version '>= 12.1'

chef_version '>= 12.1' if respond_to?(:chef_version)

depends 'compat_resource', '>= 12.10'
depends 'compat_resource', '>= 12.14.7'

0 comments on commit 0007dca

Please sign in to comment.