类: RSpec::Core::Formatters::BaseFormatter
- 继承
-
Object
- Object
- RSpec::Core::Formatters::BaseFormatter
- 定义于
- lib/rspec/core/formatters/base_formatter.rb
概述
RSpec 的内置格式化器都是 RSpec::Core::Formatters::BaseFormatter 的子类。
直接已知子类
实例属性摘要 收起
-
#example_group ⇒ void
返回属性 example_group 的值。
-
#output ⇒ void 只读
返回属性 output 的值。
实例方法摘要 收起
- #close(_notification) ⇒ void
- #example_group_started(notification) ⇒ void
-
#initialize(output) ⇒ BaseFormatter 构造函数
BaseFormatter 的一个新实例。
- #start(notification) ⇒ void
构造函数详情
#initialize(output) ⇒BaseFormatter
返回 BaseFormatter 的一个新实例。
23 24 25 26 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 23 def initialize(output) @output = output || StringIO.new @example_group = nil end |
实例属性详情
#example_group ⇒void
返回属性 example_group 的值。
17 18 19 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 17 def example_group @example_group end |
#output ⇒void (只读)
返回属性 output 的值。
18 19 20 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 18 def output @output end |
实例方法详情
#close(_notification) ⇒void
50 51 52 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 50 def close(_notification) restore_sync_output end |
#example_group_started(notification) ⇒void
42 43 44 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 42 def example_group_started(notification) @example_group = notification.group end |
#start(notification) ⇒void
32 33 34 35 |
# File 'lib/rspec/core/formatters/base_formatter.rb', line 32 def start(notification) start_sync_output @example_count = notification.count end |