Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0a5f3aa3
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,发现更多精彩内容 >>
提交
0a5f3aa3
编写于
6月 05, 2018
作者:
R
Rémy Coutable
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix-fog-mocking' into 'master'
Fix Fog mocking Closes #47300 See merge request gitlab-org/gitlab-ce!19425
上级
6153a616
53d1c87c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
18 deletion
+16
-18
spec/initializers/fog_google_https_private_urls_spec.rb
spec/initializers/fog_google_https_private_urls_spec.rb
+6
-6
spec/lib/backup/manager_spec.rb
spec/lib/backup/manager_spec.rb
+2
-5
spec/lib/object_storage/direct_upload_spec.rb
spec/lib/object_storage/direct_upload_spec.rb
+4
-0
spec/spec_helper.rb
spec/spec_helper.rb
+4
-0
spec/uploaders/object_storage_spec.rb
spec/uploaders/object_storage_spec.rb
+0
-7
未找到文件。
spec/initializers/fog_google_https_private_urls_spec.rb
浏览文件 @
0a5f3aa3
require
'spec_helper'
require
'spec_helper'
describe
'Fog::Storage::GoogleXML::File'
do
describe
'Fog::Storage::GoogleXML::File'
,
:fog_requests
do
let
(
:storage
)
do
let
(
:storage
)
do
Fog
.
mock!
Fog
.
mock!
Fog
::
Storage
.
new
(
{
Fog
::
Storage
.
new
(
google_storage_access_key_id:
"asdf"
,
google_storage_access_key_id:
"asdf"
,
google_storage_secret_access_key:
"asdf"
,
google_storage_secret_access_key:
"asdf"
,
provider:
"Google"
provider:
"Google"
}
)
)
end
end
let
(
:file
)
do
let
(
:file
)
do
...
...
spec/lib/backup/manager_spec.rb
浏览文件 @
0a5f3aa3
...
@@ -274,16 +274,13 @@ describe Backup::Manager do
...
@@ -274,16 +274,13 @@ describe Backup::Manager do
}
}
)
)
# the Fog mock only knows about directories we create explicitly
Fog
.
mock!
Fog
.
mock!
# the Fog mock only knows about directories we create explicitly
connection
=
::
Fog
::
Storage
.
new
(
Gitlab
.
config
.
backup
.
upload
.
connection
.
symbolize_keys
)
connection
=
::
Fog
::
Storage
.
new
(
Gitlab
.
config
.
backup
.
upload
.
connection
.
symbolize_keys
)
connection
.
directories
.
create
(
key:
Gitlab
.
config
.
backup
.
upload
.
remote_directory
)
connection
.
directories
.
create
(
key:
Gitlab
.
config
.
backup
.
upload
.
remote_directory
)
end
end
after
do
Fog
.
unmock!
end
context
'target path'
do
context
'target path'
do
it
'uses the tar filename by default'
do
it
'uses the tar filename by default'
do
expect_any_instance_of
(
Fog
::
Collection
).
to
receive
(
:create
)
expect_any_instance_of
(
Fog
::
Collection
).
to
receive
(
:create
)
...
...
spec/lib/object_storage/direct_upload_spec.rb
浏览文件 @
0a5f3aa3
...
@@ -17,6 +17,10 @@ describe ObjectStorage::DirectUpload do
...
@@ -17,6 +17,10 @@ describe ObjectStorage::DirectUpload do
let
(
:direct_upload
)
{
described_class
.
new
(
credentials
,
bucket_name
,
object_name
,
has_length:
has_length
,
maximum_size:
maximum_size
)
}
let
(
:direct_upload
)
{
described_class
.
new
(
credentials
,
bucket_name
,
object_name
,
has_length:
has_length
,
maximum_size:
maximum_size
)
}
before
do
Fog
.
unmock!
end
describe
'#has_length'
do
describe
'#has_length'
do
context
'is known'
do
context
'is known'
do
let
(
:has_length
)
{
true
}
let
(
:has_length
)
{
true
}
...
...
spec/spec_helper.rb
浏览文件 @
0a5f3aa3
...
@@ -133,6 +133,10 @@ RSpec.configure do |config|
...
@@ -133,6 +133,10 @@ RSpec.configure do |config|
RequestStore
.
clear!
RequestStore
.
clear!
end
end
config
.
after
(
:example
)
do
Fog
.
unmock!
if
Fog
.
mock?
end
config
.
before
(
:example
,
:mailer
)
do
config
.
before
(
:example
,
:mailer
)
do
reset_delivered_emails!
reset_delivered_emails!
end
end
...
...
spec/uploaders/object_storage_spec.rb
浏览文件 @
0a5f3aa3
...
@@ -360,13 +360,6 @@ describe ObjectStorage do
...
@@ -360,13 +360,6 @@ describe ObjectStorage do
subject
{
uploader_class
.
workhorse_authorize
(
has_length:
has_length
,
maximum_size:
maximum_size
)
}
subject
{
uploader_class
.
workhorse_authorize
(
has_length:
has_length
,
maximum_size:
maximum_size
)
}
before
do
# ensure that we use regular Fog libraries
# other tests might call `Fog.mock!` and
# it will make tests to fail
Fog
.
unmock!
end
shared_examples
'uses local storage'
do
shared_examples
'uses local storage'
do
it
"returns temporary path"
do
it
"returns temporary path"
do
is_expected
.
to
have_key
(
:TempPath
)
is_expected
.
to
have_key
(
:TempPath
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录