Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
faae74ca
H
hub
项目概览
github
/
hub
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
faae74ca
编写于
2月 02, 2014
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the cucumber test suite work against gh
gh should be compiled and named `./hub` in the project root
上级
71fb2633
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
1 deletion
+27
-1
features/steps.rb
features/steps.rb
+1
-0
features/support/env.rb
features/support/env.rb
+26
-1
未找到文件。
features/steps.rb
浏览文件 @
faae74ca
...
...
@@ -107,6 +107,7 @@ Given(/^the GitHub API server:$/) do |endpoints_str|
end
# hit our Sinatra server instead of github.com
set_env
'HUB_TEST_HOST'
,
"127.0.0.1:
#{
@server
.
port
}
"
set_env
'GH_API_HOST'
,
"http://127.0.0.1:
#{
@server
.
port
}
"
end
Given
(
/^I use a debugging proxy(?: at "(.+?)")?$/
)
do
|
address
|
...
...
features/support/env.rb
浏览文件 @
faae74ca
require
'aruba/cucumber'
require
'fileutils'
require
'forwardable'
require
'json'
system_git
=
`which git 2>/dev/null`
.
chomp
lib_dir
=
File
.
expand_path
(
'../../../lib'
,
__FILE__
)
...
...
@@ -14,7 +15,7 @@ Before do
# speed up load time by skipping RubyGems
set_env
'RUBYOPT'
,
'--disable-gems'
if
RUBY_VERSION
>
'1.9'
# put fakebin on the PATH
set_env
'PATH'
,
"
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
set_env
'PATH'
,
"
#{
File
.
dirname
(
lib_dir
)
}
:
#{
bin_dir
}
:
#{
ENV
[
'PATH'
]
}
"
# clear out GIT if it happens to be set
set_env
'GIT'
,
nil
# exclude this project's git directory from use in testing
...
...
@@ -27,6 +28,7 @@ Before do
set_env
'HUB_SYSTEM_GIT'
,
system_git
# ensure that api.github.com is actually never hit in tests
set_env
'HUB_TEST_HOST'
,
'127.0.0.1:0'
set_env
'GH_API_HOST'
,
'http://127.0.0.1:0'
# ensure we use fakebin `open` to test browsing
set_env
'BROWSER'
,
'open'
# sabotage opening a commit message editor interactively
...
...
@@ -39,6 +41,8 @@ Before do
set_env
'GIT_AUTHOR_EMAIL'
,
author_email
set_env
'GIT_COMMITTER_EMAIL'
,
author_email
set_env
'GH_VERSION'
,
'dev'
FileUtils
.
mkdir_p
ENV
[
'HOME'
]
# increase process exit timeout from the default of 3 seconds
...
...
@@ -122,6 +126,27 @@ World Module.new {
File
.
open
(
config
,
'w'
)
{
|
cfg
|
cfg
<<
YAML
.
dump
(
data
)
}
end
undef
edit_hub_config
def
edit_hub_config
config
=
File
.
join
(
ENV
[
'HOME'
],
'.config/gh'
)
FileUtils
.
mkdir_p
File
.
dirname
(
config
)
hub_config
=
{}
yield
hub_config
data
=
{
:credentials
=>
[]}
hub_config
.
each
do
|
host
,
entries
|
token
=
entries
[
0
].
fetch
(
'oauth_token'
,
false
)
data
[
:credentials
]
<<
{
:host
=>
host
,
:user
=>
entries
[
0
].
fetch
(
'user'
),
}
data
[
:credentials
].
last
[
:access_token
]
=
token
if
token
end
File
.
open
(
config
,
'w'
)
{
|
cfg
|
cfg
<<
JSON
.
generate
(
data
)
}
end
define_method
(
:text_editor_script
)
do
|
bash_code
|
File
.
open
(
"
#{
bin_dir
}
/vim"
,
'w'
,
0755
)
{
|
exe
|
exe
.
puts
"#!/bin/bash"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录