Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6b29cebb
Commit
6b29cebb
authored
Oct 13, 2019
by
gfyoung
Committed by
Thong Kuah
Oct 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string for spec/validators
parent
a7e32334
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
9 deletions
+23
-9
spec/validators/branch_filter_validator_spec.rb
spec/validators/branch_filter_validator_spec.rb
+9
-7
spec/validators/js_regex_validator_spec.rb
spec/validators/js_regex_validator_spec.rb
+2
-0
spec/validators/namespace_path_validator_spec.rb
spec/validators/namespace_path_validator_spec.rb
+3
-1
spec/validators/project_path_validator_spec.rb
spec/validators/project_path_validator_spec.rb
+3
-1
spec/validators/public_url_validator_spec.rb
spec/validators/public_url_validator_spec.rb
+2
-0
spec/validators/variable_duplicates_validator_spec.rb
spec/validators/variable_duplicates_validator_spec.rb
+2
-0
spec/validators/x509_certificate_credentials_validator_spec.rb
...validators/x509_certificate_credentials_validator_spec.rb
+2
-0
No files found.
spec/validators/branch_filter_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
BranchFilterValidator
do
...
...
@@ -6,25 +8,25 @@ describe BranchFilterValidator do
describe
'#validates_each'
do
it
'allows valid branch names'
do
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"good_branch_name"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"another/good_branch_name"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"good_branch_name"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"another/good_branch_name"
)
expect
(
hook
.
errors
.
empty?
).
to
be
true
end
it
'disallows bad branch names'
do
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"bad branch~name"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"bad branch~name"
)
expect
(
hook
.
errors
[
:push_events_branch_filter
].
empty?
).
to
be
false
end
it
'allows wildcards'
do
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"features/*"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"features/*/bla"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
"*-stable"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"features/*"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"features/*/bla"
)
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
+
"*-stable"
)
expect
(
hook
.
errors
.
empty?
).
to
be
true
end
it
'gets rid of whitespace'
do
filter
=
' master '
filter
=
+
' master '
validator
.
validate_each
(
hook
,
:push_events_branch_filter
,
filter
)
expect
(
filter
).
to
eq
'master'
...
...
spec/validators/js_regex_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
JsRegexValidator
do
...
...
spec/validators/namespace_path_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
NamespacePathValidator
do
...
...
@@ -5,7 +7,7 @@ describe NamespacePathValidator do
describe
'.valid_path?'
do
it
'handles invalid utf8'
do
expect
(
described_class
.
valid_path?
(
"a
\0
weird
\255
path"
)).
to
be_falsey
expect
(
described_class
.
valid_path?
(
+
"a
\0
weird
\255
path"
)).
to
be_falsey
end
end
...
...
spec/validators/project_path_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
ProjectPathValidator
do
...
...
@@ -5,7 +7,7 @@ describe ProjectPathValidator do
describe
'.valid_path?'
do
it
'handles invalid utf8'
do
expect
(
described_class
.
valid_path?
(
"a
\0
weird
\255
path"
)).
to
be_falsey
expect
(
described_class
.
valid_path?
(
+
"a
\0
weird
\255
path"
)).
to
be_falsey
end
end
...
...
spec/validators/public_url_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
PublicUrlValidator
do
...
...
spec/validators/variable_duplicates_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
VariableDuplicatesValidator
do
...
...
spec/validators/x509_certificate_credentials_validator_spec.rb
View file @
6b29cebb
# frozen_string_literal: true
require
'spec_helper'
describe
X509CertificateCredentialsValidator
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment