Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
e007afd3
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e007afd3
编写于
4月 25, 2016
作者:
K
Kasper Timm Hansen
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #24696 from y-yagi/remove_unnessary_option_setting
remove unnessary option setting from test runner
上级
cd9d5c11
996092ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
5 deletion
+24
-5
railties/lib/rails/tasks/routes.rake
railties/lib/rails/tasks/routes.rake
+3
-0
railties/lib/rails/test_unit/minitest_plugin.rb
railties/lib/rails/test_unit/minitest_plugin.rb
+2
-5
railties/test/application/rake_test.rb
railties/test/application/rake_test.rb
+11
-0
railties/test/application/test_runner_test.rb
railties/test/application/test_runner_test.rb
+8
-0
未找到文件。
railties/lib/rails/tasks/routes.rake
浏览文件 @
e007afd3
...
...
@@ -19,6 +19,9 @@ task routes: :environment do
OptionParser
.
new
do
|
opts
|
opts
.
banner
=
"Usage: rails routes [options]"
Rake
.
application
.
standard_rake_options
.
each
{
|
args
|
opts
.
on
(
*
args
)
}
opts
.
on
(
"-c CONTROLLER"
)
do
|
controller
|
routes_filter
=
{
controller:
controller
}
end
...
...
railties/lib/rails/test_unit/minitest_plugin.rb
浏览文件 @
e007afd3
...
...
@@ -54,7 +54,7 @@ def self.plugin_rails_options(opts, options)
options
[
:color
]
=
true
options
[
:output_inline
]
=
true
options
[
:patterns
]
=
opts
.
order!
options
[
:patterns
]
=
defined?
(
@rake_patterns
)
?
@rake_patterns
:
opts
.
order!
end
# Running several Rake tasks in a single command would trip up the runner,
...
...
@@ -73,10 +73,7 @@ def self.plugin_rails_init(options)
ENV
[
"RAILS_ENV"
]
=
options
[
:environment
]
||
"test"
unless
run_with_autorun
patterns
=
defined?
(
@rake_patterns
)
?
@rake_patterns
:
options
[
:patterns
]
::
Rails
::
TestRequirer
.
require_files
(
patterns
)
end
::
Rails
::
TestRequirer
.
require_files
(
options
[
:patterns
])
unless
run_with_autorun
unless
options
[
:full_backtrace
]
||
ENV
[
"BACKTRACE"
]
# Plugin can run without Rails loaded, check before filtering.
...
...
railties/test/application/rake_test.rb
浏览文件 @
e007afd3
...
...
@@ -228,6 +228,17 @@ def test_rails_routes_displays_message_when_no_routes_are_defined
MESSAGE
end
def
test_rake_routes_with_rake_options
app_file
"config/routes.rb"
,
<<-
RUBY
Rails.application.routes.draw do
get '/cart', to: 'cart#show'
end
RUBY
output
=
Dir
.
chdir
(
app_path
){
`bin/rake --rakefile Rakefile routes`
}
assert_equal
"Prefix Verb URI Pattern Controller#Action
\n
cart GET /cart(.:format) cart#show
\n
"
,
output
end
def
test_logger_is_flushed_when_exiting_production_rake_tasks
add_to_config
<<-
RUBY
rake_tasks do
...
...
railties/test/application/test_runner_test.rb
浏览文件 @
e007afd3
...
...
@@ -502,6 +502,14 @@ def test_pass_TEST_env_on_rake_test
assert_match
'1 runs, 1 assertions'
,
output
end
def
test_pass_rake_options
create_test_file
:models
,
'account'
output
=
Dir
.
chdir
(
app_path
)
{
`bin/rake --rakefile Rakefile --trace=stdout test`
}
assert_match
'1 runs, 1 assertions'
,
output
assert_match
'Execute test'
,
output
end
def
test_rails_db_create_all_restores_db_connection
create_test_file
:models
,
'account'
output
=
Dir
.
chdir
(
app_path
)
{
`bin/rails db:create:all db:migrate && echo ".tables" | rails dbconsole`
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录