Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
63790504
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,发现更多精彩内容 >>
未验证
提交
63790504
编写于
4月 16, 2019
作者:
V
Vishal Telangre
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add test coverage
上级
547ebcb9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
4 deletion
+13
-4
activesupport/test/notifications_test.rb
activesupport/test/notifications_test.rb
+13
-4
未找到文件。
activesupport/test/notifications_test.rb
浏览文件 @
63790504
...
@@ -302,7 +302,7 @@ def test_event_is_pushed_even_without_block
...
@@ -302,7 +302,7 @@ def test_event_is_pushed_even_without_block
class
EventTest
<
TestCase
class
EventTest
<
TestCase
def
test_events_are_initialized_with_details
def
test_events_are_initialized_with_details
time
=
Time
.
now
time
=
Concurrent
.
monotonic_time
event
=
event
(
:foo
,
time
,
time
+
0.01
,
random_id
,
{})
event
=
event
(
:foo
,
time
,
time
+
0.01
,
random_id
,
{})
assert_equal
:foo
,
event
.
name
assert_equal
:foo
,
event
.
name
...
@@ -310,15 +310,24 @@ def test_events_are_initialized_with_details
...
@@ -310,15 +310,24 @@ def test_events_are_initialized_with_details
assert_in_delta
10.0
,
event
.
duration
,
0.00001
assert_in_delta
10.0
,
event
.
duration
,
0.00001
end
end
def
test_event_cpu_time_and_idle_time_when_start_and_finish_is_not_called
time
=
Concurrent
.
monotonic_time
event
=
event
(
:foo
,
time
,
time
+
0.01
,
random_id
,
{})
assert_equal
0
,
event
.
cpu_time
assert_in_delta
10.0
,
event
.
idle_time
,
0.00001
end
def
test_events_consumes_information_given_as_payload
def
test_events_consumes_information_given_as_payload
event
=
event
(
:foo
,
Time
.
now
,
Time
.
now
+
1
,
random_id
,
payload: :bar
)
event
=
event
(
:foo
,
Concurrent
.
monotonic_time
,
Concurrent
.
monotonic_time
+
1
,
random_id
,
payload: :bar
)
assert_equal
Hash
[
payload: :bar
],
event
.
payload
assert_equal
Hash
[
payload: :bar
],
event
.
payload
end
end
def
test_event_is_parent_based_on_children
def
test_event_is_parent_based_on_children
time
=
Time
.
utc
(
2009
,
01
,
01
,
0
,
0
,
1
)
time
=
Concurrent
.
monotonic_time
parent
=
event
(
:foo
,
Time
.
utc
(
2009
),
Time
.
utc
(
2009
)
+
100
,
random_id
,
{})
parent
=
event
(
:foo
,
Concurrent
.
monotonic_time
,
Concurrent
.
monotonic_time
+
100
,
random_id
,
{})
child
=
event
(
:foo
,
time
,
time
+
10
,
random_id
,
{})
child
=
event
(
:foo
,
time
,
time
+
10
,
random_id
,
{})
not_child
=
event
(
:foo
,
time
,
time
+
100
,
random_id
,
{})
not_child
=
event
(
:foo
,
time
,
time
+
100
,
random_id
,
{})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录