Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
e4b04888
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,体验更适合开发者的 AI 搜索 >>
提交
e4b04888
编写于
9月 03, 2017
作者:
M
Matthew Draper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Preload Rails component gems in railties tests
上级
925e6d56
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
2 deletion
+22
-2
railties/test/application/configuration_test.rb
railties/test/application/configuration_test.rb
+1
-0
railties/test/application/generators_test.rb
railties/test/application/generators_test.rb
+1
-0
railties/test/application/initializers/frameworks_test.rb
railties/test/application/initializers/frameworks_test.rb
+1
-1
railties/test/isolation/abstract_unit.rb
railties/test/isolation/abstract_unit.rb
+19
-1
未找到文件。
railties/test/application/configuration_test.rb
浏览文件 @
e4b04888
...
...
@@ -314,6 +314,7 @@ def noop_email;end
end
test
"the application can be eager loaded even when there are no frameworks"
do
FileUtils
.
rm_rf
(
"
#{
app_path
}
/app/jobs/application_job.rb"
)
FileUtils
.
rm_rf
(
"
#{
app_path
}
/app/models/application_record.rb"
)
FileUtils
.
rm_rf
(
"
#{
app_path
}
/app/mailers/application_mailer.rb"
)
FileUtils
.
rm_rf
(
"
#{
app_path
}
/config/environments"
)
...
...
railties/test/application/generators_test.rb
浏览文件 @
e4b04888
...
...
@@ -174,6 +174,7 @@ def with_bare_config
test
"ARGV is mutated as expected"
do
require
"
#{
app_path
}
/config/environment"
require
"rails/command"
Rails
::
Command
.
const_set
(
"APP_PATH"
,
"rails/all"
)
FileUtils
.
cd
(
rails_root
)
do
...
...
railties/test/application/initializers/frameworks_test.rb
浏览文件 @
e4b04888
...
...
@@ -211,7 +211,7 @@ def show
test
"database middleware doesn't initialize when activerecord is not in frameworks"
do
use_frameworks
[]
require
"
#{
app_path
}
/config/environment"
assert
_nil
defined?
(
ActiveRecord
:
:
Base
)
assert
!
defined?
(
ActiveRecord
::
Base
)
||
ActiveRecord
.
autoload?
(
:Base
)
end
test
"use schema cache dump"
do
...
...
railties/test/isolation/abstract_unit.rb
浏览文件 @
e4b04888
...
...
@@ -299,7 +299,7 @@ def controller(name, contents)
end
def
use_frameworks
(
arr
)
to_remove
=
[
:actionmailer
,
:activerecord
]
-
arr
to_remove
=
[
:actionmailer
,
:activerecord
,
:activestorage
,
:activejob
]
-
arr
if
to_remove
.
include?
(
:activerecord
)
remove_from_config
"config.active_record.*"
...
...
@@ -329,4 +329,22 @@ class ActiveSupport::TestCase
File
.
open
(
"
#{
app_template_path
}
/config/boot.rb"
,
"w"
)
do
|
f
|
f
.
puts
"require 'rails/all'"
end
# Fake 'Bundler.require' -- we run using the repo's Gemfile, not an
# app-specific one: we don't want to require every gem that lists.
contents
=
File
.
read
(
"
#{
app_template_path
}
/config/application.rb"
)
contents
.
sub!
(
/^Bundler\.require.*/
,
"%w(turbolinks).each { |r| require r }"
)
File
.
write
(
"
#{
app_template_path
}
/config/application.rb"
,
contents
)
require
"rails"
require
"active_model"
require
"active_job"
require
"active_record"
require
"action_controller"
require
"action_mailer"
require
"action_view"
require
"active_storage"
require
"action_cable"
require
"sprockets"
end
unless
defined?
(
RAILS_ISOLATED_ENGINE
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录