类: RSpec::Core::Notifications::CustomNotification

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

概述

CustomNotification 用于向格式化程序/其他注册的监听器发送自定义事件,它根据提供的选项哈希创建属性。

类方法摘要 收起

类方法详情

.for(options = {}) ⇒CustomNotification

根据提供的选项键/值对构建自定义通知。

参数

  • options (Hash) (默认值: {})

    要在此通知上创建的键/值对的哈希

返回值

517
518
519
520
# File 'lib/rspec/core/notifications.rb', line 517
def self.for(options={})
  return NullNotification if options.keys.empty?
  new(*options.keys).new(*options.values)
end