Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
96160270
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
96160270
编写于
5月 18, 2017
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'rubocop-expect-output' into 'master'
Enable the RSpec/ExpectOutput cop See merge request !11500
上级
e4eec191
bdf5b6ad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
18 deletion
+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
未找到文件。
.rubocop.yml
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录