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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
96160270
Commit
96160270
authored
May 18, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rubocop-expect-output' into 'master'
Enable the RSpec/ExpectOutput cop See merge request !11500
parents
e4eec191
bdf5b6ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
18 deletions
+15
-18
.rubocop.yml
.rubocop.yml
+3
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-4
spec/bin/changelog_spec.rb
spec/bin/changelog_spec.rb
+1
-3
spec/tasks/gitlab/gitaly_rake_spec.rb
spec/tasks/gitlab/gitaly_rake_spec.rb
+11
-11
No files found.
.rubocop.yml
View file @
96160270
...
...
@@ -987,6 +987,9 @@ RSpec/ExampleWording:
RSpec/ExpectActual
:
Enabled
:
true
RSpec/ExpectOutput
:
Enabled
:
true
# Checks the file and folder naming of the spec file.
RSpec/FilePath
:
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
96160270
...
...
@@ -23,10 +23,6 @@ RSpec/EmptyLineAfterFinalLet:
RSpec/EmptyLineAfterSubject
:
Enabled
:
false
# Offense count: 3
RSpec/ExpectOutput
:
Enabled
:
false
# Offense count: 72
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: implicit, each, example
...
...
spec/bin/changelog_spec.rb
View file @
96160270
...
...
@@ -46,9 +46,7 @@ describe 'bin/changelog' do
it
'parses -h'
do
expect
do
$stdout
=
StringIO
.
new
described_class
.
parse
(
%w[foo -h bar]
)
expect
{
described_class
.
parse
(
%w[foo -h bar]
)
}.
to
output
.
to_stdout
end
.
to
raise_error
(
SystemExit
)
end
...
...
spec/tasks/gitlab/gitaly_rake_spec.rb
View file @
96160270
...
...
@@ -84,24 +84,24 @@ describe 'gitlab:gitaly namespace rake task' do
}
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
(
config
)
orig_stdout
=
$stdout
$stdout
=
StringIO
.
new
header
=
''
expected_output
=
''
Timecop
.
freeze
do
header
=
<<~
TOML
expected_output
=
<<~
TOML
# Gitaly storage configuration generated from
#{
Gitlab
.
config
.
source
}
on
#{
Time
.
current
.
to_s
(
:long
)
}
# This is in TOML format suitable for use in Gitaly's config.toml file.
[[storage]]
name = "default"
path = "/path/to/default"
[[storage]]
name = "nfs_01"
path = "/path/to/nfs_01"
TOML
run_rake_task
(
'gitlab:gitaly:storage_config'
)
end
output
=
$stdout
.
string
$stdout
=
orig_stdout
expect
(
output
).
to
include
(
header
)
expect
{
run_rake_task
(
'gitlab:gitaly:storage_config'
)}.
to
output
(
expected_output
).
to_stdout
parsed_output
=
TOML
.
parse
(
output
)
parsed_output
=
TOML
.
parse
(
expected_
output
)
config
.
each
do
|
name
,
params
|
expect
(
parsed_output
[
'storage'
]).
to
include
({
'name'
=>
name
,
'path'
=>
params
[
'path'
]
})
end
...
...
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