Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f0ce915

Browse files
committedApr 7, 2015
[Specification::Linter] Disallow slashes in spec names
1 parent ed08d80 commit f0ce915

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎lib/cocoapods-core/specification/linter.rb

+5
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ def validate_name
178178
'name of the file.')
179179
end
180180

181+
if spec.name =~ /\//
182+
results.add_error('name', 'The name of a spec should not contain ' \
183+
'a slash.')
184+
end
185+
181186
if spec.root.name =~ /\s/
182187
results.add_error('name', 'The name of a spec should not contain ' \
183188
'whitespace.')

‎spec/specification/linter_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def result_should_include(*values)
150150
result_should_include('name', 'whitespace')
151151
end
152152

153+
it 'fails a specification whose name contains a slash' do
154+
@spec.stubs(:name).returns('BananaKit/BananaFruit')
155+
result_should_include('name', 'slash')
156+
end
157+
153158
#------------------#
154159

155160
it 'fails a specification whose authors are the default' do

0 commit comments

Comments
 (0)
Please sign in to comment.