类: RSpec::Core::Formatters::ProfileFormatter 私有

继承
Object
  • Object
显示全部
定义于
lib/rspec/core/formatters/profile_formatter.rb

概述

此类是私有 API 的一部分。 应尽量避免使用此类,因为它可能会在将来被移除或更改。

用于提供配置文件输出的格式化程序。

实例方法摘要 折叠

构造函数详情

#initialize(output) ⇒ProfileFormatter

此方法是私有 API 的一部分。 应尽量避免使用此方法,因为它可能会在将来被移除或更改。

返回 ProfileFormatter 的新实例。

11
12
13
# File 'lib/rspec/core/formatters/profile_formatter.rb', line 11
def initialize(output)
  @output = output
end

实例方法详情

#dump_profile(profile) ⇒void

如果启用了分析,则会在转储摘要后调用此方法。

参数

  • profile (ProfileNotification)

    包含持续时间、最慢的示例和最慢的示例组

25
26
27
28
# File 'lib/rspec/core/formatters/profile_formatter.rb', line 25
def dump_profile(profile)
  dump_profile_slowest_examples(profile)
  dump_profile_slowest_example_groups(profile)
end