From 8599bc8f34a42ef1c4539231dc3c287469e36313 Mon Sep 17 00:00:00 2001 From: Joshua Kalpin Date: Tue, 22 Oct 2013 22:43:35 -0700 Subject: [PATCH] Adding a warning for leaving the homepage as default in a podspec. --- lib/cocoapods-core/specification/linter.rb | 4 ++++ spec/specification/linter_spec.rb | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/cocoapods-core/specification/linter.rb b/lib/cocoapods-core/specification/linter.rb index f0a6b3544..588ff84fd 100644 --- a/lib/cocoapods-core/specification/linter.rb +++ b/lib/cocoapods-core/specification/linter.rb @@ -223,6 +223,10 @@ def _validate_description(d) warning "The description is shorter than the summary." if d.length < spec.summary.length end + def _validate_homepage(h) + warning "The homepage has not been updated from default" if h =~ /http:\/\/EXAMPLE/ + end + # Performs validations related to the `license` attribute. # def _validate_license(l) diff --git a/spec/specification/linter_spec.rb b/spec/specification/linter_spec.rb index d994f819c..131e61647 100644 --- a/spec/specification/linter_spec.rb +++ b/spec/specification/linter_spec.rb @@ -211,6 +211,13 @@ def message_should_include(*values) #------------------# + it "checks if the homepage has been changed from default" do + @spec.stubs(:homepage).returns('http://EXAMPLE/test') + message_should_include('homepage', 'default') + end + + #------------------# + it "checks whether the license type" do @spec.stubs(:license).returns({ :file => 'License' }) message_should_include('license', 'type')