Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1bf52208
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,发现更多精彩内容 >>
提交
1bf52208
编写于
10月 05, 2014
作者:
F
fillman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix autoload tests
上级
85c3d5b2
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
17 addition
and
6 deletion
+17
-6
activesupport/test/autoload_test.rb
activesupport/test/autoload_test.rb
+17
-6
未找到文件。
activesupport/test/autoload_test.rb
浏览文件 @
1bf52208
...
@@ -11,6 +11,11 @@ module Autoload
...
@@ -11,6 +11,11 @@ module Autoload
end
end
end
end
def
setup
@some_class_path
=
File
.
expand_path
(
"test/fixtures/autoload/some_class.rb"
)
@another_class_path
=
File
.
expand_path
(
"test/fixtures/autoload/another_class.rb"
)
end
test
"the autoload module works like normal autoload"
do
test
"the autoload module works like normal autoload"
do
module
::
Fixtures
::
Autoload
module
::
Fixtures
::
Autoload
autoload
:SomeClass
,
"fixtures/autoload/some_class"
autoload
:SomeClass
,
"fixtures/autoload/some_class"
...
@@ -21,10 +26,12 @@ module ::Fixtures::Autoload
...
@@ -21,10 +26,12 @@ module ::Fixtures::Autoload
test
"when specifying an :eager constant it still works like normal autoload by default"
do
test
"when specifying an :eager constant it still works like normal autoload by default"
do
module
::
Fixtures
::
Autoload
module
::
Fixtures
::
Autoload
eager_autoload
do
autoload
:SomeClass
,
"fixtures/autoload/some_class"
autoload
:SomeClass
,
"fixtures/autoload/some_class"
end
end
end
assert
!
$LOADED_FEATURES
.
include?
(
"fixtures/autoload/some_class.rb"
)
assert
!
$LOADED_FEATURES
.
include?
(
@some_class_path
)
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
end
end
...
@@ -33,16 +40,20 @@ module ::Fixtures::Autoload
...
@@ -33,16 +40,20 @@ module ::Fixtures::Autoload
autoload
:SomeClass
autoload
:SomeClass
end
end
assert
!
$LOADED_FEATURES
.
include?
(
"fixtures/autoload/some_class.rb"
)
assert
!
$LOADED_FEATURES
.
include?
(
@some_class_path
)
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
end
end
test
"the location of :eager autoloaded constants defaults to :name.underscore"
do
test
"the location of :eager autoloaded constants defaults to :name.underscore"
do
module
::
Fixtures
::
Autoload
module
::
Fixtures
::
Autoload
eager_autoload
do
autoload
:SomeClass
autoload
:SomeClass
end
end
end
assert
!
$LOADED_FEATURES
.
include?
(
@some_class_path
)
::
Fixtures
::
Autoload
.
eager_load!
::
Fixtures
::
Autoload
.
eager_load!
assert
$LOADED_FEATURES
.
include?
(
@some_class_path
)
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
assert_nothing_raised
{
::
Fixtures
::
Autoload
::
SomeClass
}
end
end
...
@@ -53,7 +64,7 @@ module ::Fixtures
...
@@ -53,7 +64,7 @@ module ::Fixtures
end
end
end
end
assert
!
$LOADED_FEATURES
.
include?
(
"fixtures/autoload/another_class.rb"
)
assert
!
$LOADED_FEATURES
.
include?
(
@another_class_path
)
assert_nothing_raised
{
::
Fixtures
::
AnotherClass
}
assert_nothing_raised
{
::
Fixtures
::
AnotherClass
}
end
end
...
@@ -64,7 +75,7 @@ module ::Fixtures
...
@@ -64,7 +75,7 @@ module ::Fixtures
end
end
end
end
assert
!
$LOADED_FEATURES
.
include?
(
"fixtures/autoload/another_class.rb"
)
assert
!
$LOADED_FEATURES
.
include?
(
@another_class_path
)
assert_nothing_raised
{
::
Fixtures
::
AnotherClass
}
assert_nothing_raised
{
::
Fixtures
::
AnotherClass
}
end
end
end
end
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录