类: RSpec::Core::Formatters::Loader 私有

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

概述

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

RSpec::Core::Formatters::Loader 是一个用于管理特定配置使用的格式化程序的内部类。预期它不会直接使用,而只能通过配置接口使用。

实例属性摘要 折叠

类方法摘要 折叠

实例方法摘要 折叠

构造函数详细信息

#initialize(reporter) ⇒Loader

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

返回 Loader 的新实例。

105
106
107
108
109
# File 'lib/rspec/core/formatters.rb', line 105
def initialize(reporter)
  @formatters = []
  @reporter = reporter
  self.default_formatter = 'progress'
end

实例属性详细信息

#default_formatterString

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

返回要设置的默认格式化程序,默认为 progress

返回

  • (String)

    要设置的默认格式化程序,默认为 progress

118
119
120
# File 'lib/rspec/core/formatters.rb', line 118
def default_formatter
  @default_formatter
end

#formattersArray (只读)

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

返回已加载的格式化程序。

返回

  • (Array)

    已加载的格式化程序

112
113
114
# File 'lib/rspec/core/formatters.rb', line 112
def formatters
  @formatters
end

#reporterReporter (只读)

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

返回报告器。

返回

115
116
117
# File 'lib/rspec/core/formatters.rb', line 115
def reporter
  @reporter
end

类方法详细信息

.formattersvoid

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

内部格式化程序在加载时存储在此处。

100
101
102
# File 'lib/rspec/core/formatters.rb', line 100
def self.formatters
  @formatters ||= {}
end