diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-07-16 00:26:38 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-07-16 00:26:38 -0700 |
commit | c4da00194a9a8c855eb4395cb7e06c6e166a2e73 (patch) | |
tree | 67286919cdcea2d98b701a47be61b9102e499791 /chef/lib/chef/cookbook | |
parent | eaccda3cc77ad1ed9165f39e4ee15fa147698286 (diff) | |
download | chef-c4da00194a9a8c855eb4395cb7e06c6e166a2e73.tar.gz |
[CHEF-1202] add missing tests to verify updated regexes
Diffstat (limited to 'chef/lib/chef/cookbook')
-rw-r--r-- | chef/lib/chef/cookbook/metadata.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chef/lib/chef/cookbook/metadata.rb b/chef/lib/chef/cookbook/metadata.rb index 5843e2ef0b..e6da1a8a62 100644 --- a/chef/lib/chef/cookbook/metadata.rb +++ b/chef/lib/chef/cookbook/metadata.rb @@ -26,6 +26,11 @@ require 'chef/cookbook/metadata/version' class Chef class Cookbook class Metadata + + COMPARISON_FIELDS = [ :name, :description, :long_description, :maintainer, + :maintainer_email, :license, :platforms, :dependencies, + :recommendations, :suggestions, :conflicting, :providing, + :replacing, :attributes, :groupings, :recipes, :version] include Chef::Mixin::CheckHelper include Chef::Mixin::ParamsValidate @@ -83,6 +88,12 @@ class Chef end end + def ==(other) + COMPARISON_FIELDS.inject(true) do |equal_so_far, field| + equal_so_far && other.respond_to?(field) && (other.send(field) == send(field)) + end + end + # Sets the cookbooks maintainer, or returns it. # # === Parameters |