类:RSpec::Core::Notifications::DeprecationNotification

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

概述

当遇到 RSpec 的已弃用部分时,报告器会发出 DeprecationNotification。它代表有关已弃用调用位置的信息。

实例属性摘要 折叠

类方法摘要 折叠

实例属性详细信息

#call_siteString

发出弃用警告的可选调用位置

返回值

  • (String)

    call_site 的当前值

493
494
495
# File 'lib/rspec/core/notifications.rb', line 493
def call_site
  @call_site
end

#deprecatedString

关于弃用警告的自定义消息(message 的别名)

返回值

  • (String)

    deprecated 的当前值

493
494
495
# File 'lib/rspec/core/notifications.rb', line 493
def deprecated
  @deprecated
end

#messageString

关于弃用警告的自定义消息

返回值

  • (String)

    message 的当前值

493
494
495
# File 'lib/rspec/core/notifications.rb', line 493
def message
  @message
end

#replacementString

弃用警告的可选替代方法

返回值

  • (String)

    replacement 的当前值

493
494
495
# File 'lib/rspec/core/notifications.rb', line 493
def replacement
  @replacement
end

类方法详细信息

.from_hash(data) ⇒void

初始化通知的便捷方法

499
500
501
# File 'lib/rspec/core/notifications.rb', line 499
def self.from_hash(data)
  new data[:deprecated], data[:message], data[:replacement], data[:call_site]
end