Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
595856c4
H
hub
项目概览
github
/
hub
9 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
595856c4
编写于
10月 29, 2019
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test] Ensure that cukes do write operations outside of project dir
上级
ba47de35
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
4 deletion
+12
-4
features/support/env.rb
features/support/env.rb
+12
-4
未找到文件。
features/support/env.rb
浏览文件 @
595856c4
...
...
@@ -5,6 +5,13 @@ require 'tmpdir'
system_git
=
`which git 2>/dev/null`
.
chomp
bin_dir
=
File
.
expand_path
(
'../fakebin'
,
__FILE__
)
tmpdir
=
Dir
.
mktmpdir
(
'hub_test'
)
tmp_bin_dir
=
"
#{
tmpdir
}
/bin"
Aruba
.
configure
do
|
aruba
|
aruba
.
send
(
:find_option
,
:root_directory
).
value
=
tmpdir
end
hub_dir
=
Dir
.
mktmpdir
(
'hub_build'
)
raise
'hub build failed'
unless
system
(
"./script/build -o
#{
hub_dir
}
/hub"
)
...
...
@@ -16,7 +23,7 @@ Before do
# speed up load time by skipping RubyGems
'RUBYOPT'
=>
'--disable-gems'
,
# put fakebin on the PATH
'PATH'
=>
"
#{
hub_dir
}
:
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
,
'PATH'
=>
"
#{
hub_dir
}
:
#{
tmp_bin_dir
}
:
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
,
# clear out GIT if it happens to be set
'GIT'
=>
nil
,
# exclude this project's git directory from use in testing
...
...
@@ -25,7 +32,7 @@ Before do
'GIT_PROXY_COMMAND'
=>
'echo'
,
# avoids reading from current user's "~/.gitconfig"
'HOME'
=>
expand_path
(
'home'
),
'TMPDIR'
=>
expand_path
(
'tmp'
)
,
'TMPDIR'
=>
tmpdir
,
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
'XDG_CONFIG_HOME'
=>
nil
,
'XDG_CONFIG_DIRS'
=>
nil
,
...
...
@@ -62,7 +69,7 @@ end
After
do
@server
.
stop
if
defined?
@server
and
@server
FileUtils
.
rm_f
(
"
#{
bin_dir
}
/vim"
)
FileUtils
.
rm_f
(
"
#{
tmp_
bin_dir
}
/vim"
)
end
After
(
'@cache_clear'
)
do
...
...
@@ -118,7 +125,8 @@ World Module.new {
end
define_method
(
:text_editor_script
)
do
|
bash_code
|
File
.
open
(
"
#{
bin_dir
}
/vim"
,
'w'
,
0755
)
{
|
exe
|
FileUtils
.
mkdir_p
(
tmp_bin_dir
)
File
.
open
(
"
#{
tmp_bin_dir
}
/vim"
,
'w'
,
0755
)
{
|
exe
|
exe
.
puts
"#!/bin/bash"
exe
.
puts
"set -e"
exe
.
puts
bash_code
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录