Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
630cc857
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,发现更多精彩内容 >>
提交
630cc857
编写于
12月 25, 2016
作者:
A
Akira Matsuda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"Use assert_nil if expecting nil from ...:in `...'. This will fail in MT6."
上级
5b874cf4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
15 deletion
+15
-15
actionpack/test/controller/flash_hash_test.rb
actionpack/test/controller/flash_hash_test.rb
+4
-4
activerecord/test/cases/adapters/mysql2/json_test.rb
activerecord/test/cases/adapters/mysql2/json_test.rb
+2
-2
activerecord/test/cases/adapters/postgresql/bytea_test.rb
activerecord/test/cases/adapters/postgresql/bytea_test.rb
+4
-4
activerecord/test/cases/adapters/postgresql/json_test.rb
activerecord/test/cases/adapters/postgresql/json_test.rb
+2
-2
activerecord/test/cases/adapters/postgresql/uuid_test.rb
activerecord/test/cases/adapters/postgresql/uuid_test.rb
+2
-2
activesupport/test/core_ext/hash_ext_test.rb
activesupport/test/core_ext/hash_ext_test.rb
+1
-1
未找到文件。
actionpack/test/controller/flash_hash_test.rb
浏览文件 @
630cc857
...
@@ -63,10 +63,10 @@ def test_to_session_value
...
@@ -63,10 +63,10 @@ def test_to_session_value
assert_equal
({
"flashes"
=>
{
"foo"
=>
"bar"
},
"discard"
=>
[]
},
@hash
.
to_session_value
)
assert_equal
({
"flashes"
=>
{
"foo"
=>
"bar"
},
"discard"
=>
[]
},
@hash
.
to_session_value
)
@hash
.
discard
(
"foo"
)
@hash
.
discard
(
"foo"
)
assert_
equal
(
nil
,
@hash
.
to_session_value
)
assert_
nil
(
@hash
.
to_session_value
)
@hash
.
sweep
@hash
.
sweep
assert_
equal
(
nil
,
@hash
.
to_session_value
)
assert_
nil
(
@hash
.
to_session_value
)
end
end
def
test_from_session_value
def
test_from_session_value
...
@@ -75,7 +75,7 @@ def test_from_session_value
...
@@ -75,7 +75,7 @@ def test_from_session_value
session
=
Marshal
.
load
(
Base64
.
decode64
(
rails_3_2_cookie
))
session
=
Marshal
.
load
(
Base64
.
decode64
(
rails_3_2_cookie
))
hash
=
Flash
::
FlashHash
.
from_session_value
(
session
[
"flash"
])
hash
=
Flash
::
FlashHash
.
from_session_value
(
session
[
"flash"
])
assert_equal
({
"greeting"
=>
"Hello"
},
hash
.
to_hash
)
assert_equal
({
"greeting"
=>
"Hello"
},
hash
.
to_hash
)
assert_
equal
(
nil
,
hash
.
to_session_value
)
assert_
nil
(
hash
.
to_session_value
)
end
end
def
test_from_session_value_on_json_serializer
def
test_from_session_value_on_json_serializer
...
@@ -84,7 +84,7 @@ def test_from_session_value_on_json_serializer
...
@@ -84,7 +84,7 @@ def test_from_session_value_on_json_serializer
hash
=
Flash
::
FlashHash
.
from_session_value
(
session
[
"flash"
])
hash
=
Flash
::
FlashHash
.
from_session_value
(
session
[
"flash"
])
assert_equal
({
"greeting"
=>
"Hello"
},
hash
.
to_hash
)
assert_equal
({
"greeting"
=>
"Hello"
},
hash
.
to_hash
)
assert_
equal
(
nil
,
hash
.
to_session_value
)
assert_
nil
(
hash
.
to_session_value
)
assert_equal
"Hello"
,
hash
[
:greeting
]
assert_equal
"Hello"
,
hash
[
:greeting
]
assert_equal
"Hello"
,
hash
[
"greeting"
]
assert_equal
"Hello"
,
hash
[
"greeting"
]
end
end
...
...
activerecord/test/cases/adapters/mysql2/json_test.rb
浏览文件 @
630cc857
...
@@ -93,7 +93,7 @@ def test_select_multikey
...
@@ -93,7 +93,7 @@ def test_select_multikey
def
test_null_json
def
test_null_json
@connection
.
execute
"insert into json_data_type (payload) VALUES(null)"
@connection
.
execute
"insert into json_data_type (payload) VALUES(null)"
x
=
JsonDataType
.
first
x
=
JsonDataType
.
first
assert_
equal
(
nil
,
x
.
payload
)
assert_
nil
(
x
.
payload
)
end
end
def
test_select_array_json_value
def
test_select_array_json_value
...
@@ -111,7 +111,7 @@ def test_select_nil_json_after_create
...
@@ -111,7 +111,7 @@ def test_select_nil_json_after_create
def
test_select_nil_json_after_update
def
test_select_nil_json_after_update
json
=
JsonDataType
.
create
(
payload:
"foo"
)
json
=
JsonDataType
.
create
(
payload:
"foo"
)
x
=
JsonDataType
.
where
(
payload:
nil
).
first
x
=
JsonDataType
.
where
(
payload:
nil
).
first
assert_
equal
(
nil
,
x
)
assert_
nil
(
x
)
json
.
update_attributes
payload:
nil
json
.
update_attributes
payload:
nil
x
=
JsonDataType
.
where
(
payload:
nil
).
first
x
=
JsonDataType
.
where
(
payload:
nil
).
first
...
...
activerecord/test/cases/adapters/postgresql/bytea_test.rb
浏览文件 @
630cc857
...
@@ -52,7 +52,7 @@ def test_type_cast_binary_value
...
@@ -52,7 +52,7 @@ def test_type_cast_binary_value
end
end
def
test_type_case_nil
def
test_type_case_nil
assert_
equal
(
nil
,
@type
.
deserialize
(
nil
))
assert_
nil
(
@type
.
deserialize
(
nil
))
end
end
def
test_read_value
def
test_read_value
...
@@ -66,7 +66,7 @@ def test_read_value
...
@@ -66,7 +66,7 @@ def test_read_value
def
test_read_nil_value
def
test_read_nil_value
@connection
.
execute
"insert into bytea_data_type (payload) VALUES (null)"
@connection
.
execute
"insert into bytea_data_type (payload) VALUES (null)"
record
=
ByteaDataType
.
first
record
=
ByteaDataType
.
first
assert_
equal
(
nil
,
record
.
payload
)
assert_
nil
(
record
.
payload
)
record
.
delete
record
.
delete
end
end
...
@@ -106,8 +106,8 @@ def test_write_binary
...
@@ -106,8 +106,8 @@ def test_write_binary
def
test_write_nil
def
test_write_nil
record
=
ByteaDataType
.
create
(
payload:
nil
)
record
=
ByteaDataType
.
create
(
payload:
nil
)
assert_not
record
.
new_record?
assert_not
record
.
new_record?
assert_
equal
(
nil
,
record
.
payload
)
assert_
nil
(
record
.
payload
)
assert_
equal
(
nil
,
ByteaDataType
.
where
(
id:
record
.
id
).
first
.
payload
)
assert_
nil
(
ByteaDataType
.
where
(
id:
record
.
id
).
first
.
payload
)
end
end
class
Serializer
class
Serializer
...
...
activerecord/test/cases/adapters/postgresql/json_test.rb
浏览文件 @
630cc857
...
@@ -110,7 +110,7 @@ def test_select_multikey
...
@@ -110,7 +110,7 @@ def test_select_multikey
def
test_null_json
def
test_null_json
@connection
.
execute
"insert into json_data_type (payload) VALUES(null)"
@connection
.
execute
"insert into json_data_type (payload) VALUES(null)"
x
=
JsonDataType
.
first
x
=
JsonDataType
.
first
assert_
equal
(
nil
,
x
.
payload
)
assert_
nil
(
x
.
payload
)
end
end
def
test_select_nil_json_after_create
def
test_select_nil_json_after_create
...
@@ -122,7 +122,7 @@ def test_select_nil_json_after_create
...
@@ -122,7 +122,7 @@ def test_select_nil_json_after_create
def
test_select_nil_json_after_update
def
test_select_nil_json_after_update
json
=
JsonDataType
.
create
(
payload:
"foo"
)
json
=
JsonDataType
.
create
(
payload:
"foo"
)
x
=
JsonDataType
.
where
(
payload:
nil
).
first
x
=
JsonDataType
.
where
(
payload:
nil
).
first
assert_
equal
(
nil
,
x
)
assert_
nil
(
x
)
json
.
update_attributes
payload:
nil
json
.
update_attributes
payload:
nil
x
=
JsonDataType
.
where
(
payload:
nil
).
first
x
=
JsonDataType
.
where
(
payload:
nil
).
first
...
...
activerecord/test/cases/adapters/postgresql/uuid_test.rb
浏览文件 @
630cc857
...
@@ -71,12 +71,12 @@ def test_data_type_of_uuid_types
...
@@ -71,12 +71,12 @@ def test_data_type_of_uuid_types
def
test_treat_blank_uuid_as_nil
def
test_treat_blank_uuid_as_nil
UUIDType
.
create!
guid:
""
UUIDType
.
create!
guid:
""
assert_
equal
(
nil
,
UUIDType
.
last
.
guid
)
assert_
nil
(
UUIDType
.
last
.
guid
)
end
end
def
test_treat_invalid_uuid_as_nil
def
test_treat_invalid_uuid_as_nil
uuid
=
UUIDType
.
create!
guid:
"foobar"
uuid
=
UUIDType
.
create!
guid:
"foobar"
assert_
equal
(
nil
,
uuid
.
guid
)
assert_
nil
(
uuid
.
guid
)
end
end
def
test_invalid_uuid_dont_modify_before_type_cast
def
test_invalid_uuid_dont_modify_before_type_cast
...
...
activesupport/test/core_ext/hash_ext_test.rb
浏览文件 @
630cc857
...
@@ -1017,7 +1017,7 @@ def test_compact!
...
@@ -1017,7 +1017,7 @@ def test_compact!
assert_equal
({},
h
)
assert_equal
({},
h
)
h
=
@symbols
.
dup
h
=
@symbols
.
dup
assert_
equal
(
nil
,
h
.
compact!
)
assert_
nil
(
h
.
compact!
)
assert_equal
(
@symbols
,
h
)
assert_equal
(
@symbols
,
h
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录