Skip to content

Commit

Permalink
Merge b3d16f0 into 4ed00ac
Browse files Browse the repository at this point in the history
  • Loading branch information
kapin committed Nov 30, 2013
2 parents 4ed00ac + b3d16f0 commit 77d0804
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def _validate_homepage(h)
end
end

def _validate_frameworks(frameworks)
check_frameworks(frameworks)
end

def _validate_weak_frameworks(frameworks)
check_frameworks(frameworks)
end

# Performs validations related to the `license` attribute.
#
def _validate_license(l)
Expand Down Expand Up @@ -395,6 +403,13 @@ def check_install_hooks
end
end

def check_frameworks(frameworks)
if frameworks.any? { |framework| framework.end_with?('.framework')}
error "Frameworks should be specified by their name only."
end
end


#-----------------------------------------------------------------------#

# !@group Result Helpers
Expand Down
12 changes: 12 additions & 0 deletions spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ def message_should_include(*values)
@spec.stubs(:source).returns({:git => 'www.banana-empire.git'})
message_should_include('sources', 'specify a tag.')
end

#------------------#

it "checks that frameworks do not end with a .framework extension" do
@spec.stubs(:frameworks).returns(['AddressBook.framework', 'QuartzCore.framework'])
message_should_include('framework', 'name only')
end

it "checks that weak frameworks do not end with a .framework extension" do
@spec.stubs(:weak_frameworks).returns(['AddressBook.framework', 'QuartzCore.framework'])
message_should_include('framework', 'name only')
end
end

#--------------------------------------#
Expand Down

0 comments on commit 77d0804

Please sign in to comment.