summaryrefslogtreecommitdiff
path: root/spec/unit/cookbook/metadata_spec.rb
diff options
context:
space:
mode:
authorBrett and Tristan <brett+brettchalupa+tristanoneil@gofullstack.com>2014-08-25 11:25:18 -0400
committerBrett Chalupa <brettchalupa@gmail.com>2014-08-25 11:25:18 -0400
commite15e376668cfa638da83d9a78edf3232cd07890f (patch)
tree54b61ec56d4dfaa2a5093d90bb6b30a323fb509c /spec/unit/cookbook/metadata_spec.rb
parentb49767dd1ed9c778f94bef597e52a61d48491b50 (diff)
downloadchef-e15e376668cfa638da83d9a78edf3232cd07890f.tar.gz
Add supermarket_attributes to Metadata
Allow the metadata.rb in a cookbook to specify arbitrary attributes for use from Supermarket. The usecase for this right now would be setting the issues and source URLs for that Cookbook instead of specifying them in the Supermarket UI.
Diffstat (limited to 'spec/unit/cookbook/metadata_spec.rb')
-rw-r--r--spec/unit/cookbook/metadata_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb
index e61c85b42b..a99131e33e 100644
--- a/spec/unit/cookbook/metadata_spec.rb
+++ b/spec/unit/cookbook/metadata_spec.rb
@@ -140,6 +140,9 @@ describe Chef::Cookbook::Metadata do
metadata.recipes.should eq(Mash.new)
end
+ it "has an empty supermarket_attributes list" do
+ metadata.supermarket_attributes.should eq(Mash.new)
+ end
end
describe "validation" do
@@ -732,4 +735,18 @@ describe Chef::Cookbook::Metadata do
end
+ describe "supermarket_attributes" do
+ it "should set supermarket_attributes equal to a given hash" do
+ attrs = Mash.new(
+ :source_url => "https://github.com/opscode-cookbooks/supermarket",
+ :issues_url => "https://github.com/opscode-cookbooks/supermarket/issues"
+ )
+
+ metadata.supermarket_attributes(attrs)
+
+ metadata.supermarket_attributes[:source_url].should == attrs[:source_url]
+ metadata.supermarket_attributes[:issues_url].should == attrs[:issues_url]
+ end
+ end
+
end