类:RSpec::Core::Notifications::DeprecationNotification
- 继承
-
Struct
- Object
- Struct
- RSpec::Core::Notifications::DeprecationNotification
- 定义于
- lib/rspec/core/notifications.rb,
lib/rspec/core/notifications.rb
概述
当遇到 RSpec 的已弃用部分时,报告器会发出 DeprecationNotification
。它代表有关已弃用调用位置的信息。
实例属性摘要 折叠
-
#call_site ⇒ String
发出弃用警告的可选调用位置。
-
#deprecated ⇒ String
关于弃用警告的自定义消息(message 的别名)。
-
#message ⇒ String
关于弃用警告的自定义消息。
-
#replacement ⇒ String
弃用警告的可选替代方法。
类方法摘要 折叠
-
.from_hash(data) ⇒ void
初始化通知的便捷方法。
实例属性详细信息
#call_site ⇒String
发出弃用警告的可选调用位置
493 494 495 |
# File 'lib/rspec/core/notifications.rb', line 493 def call_site @call_site end |
#deprecated ⇒String
关于弃用警告的自定义消息(message 的别名)
493 494 495 |
# File 'lib/rspec/core/notifications.rb', line 493 def deprecated @deprecated end |
#message ⇒String
关于弃用警告的自定义消息
493 494 495 |
# File 'lib/rspec/core/notifications.rb', line 493 def @message end |
#replacement ⇒String
弃用警告的可选替代方法
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 |