Class: RSpec::Core::Notifications::DeprecationNotification

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/core/notifications.rb,
lib/rspec/core/notifications.rb

Overview

The DeprecationNotification is issued by the reporter when a deprecated part of RSpec is encountered. It represents information about the deprecated call site.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Attribute Details

- (String) call_site

An optional call site from which the deprecation was issued

Returns:

  • (String)

    the current value of call_site

587
588
589
# File 'lib/rspec/core/notifications.rb', line 587
def call_site
  @call_site
end

- (String) deprecated

A custom message about the deprecation (alias of message)

Returns:

  • (String)

    the current value of deprecated

587
588
589
# File 'lib/rspec/core/notifications.rb', line 587
def deprecated
  @deprecated
end

- (String) message

A custom message about the deprecation

Returns:

  • (String)

    the current value of message

587
588
589
# File 'lib/rspec/core/notifications.rb', line 587
def message
  @message
end

- (String) replacement

An optional replacement for the deprecation

Returns:

  • (String)

    the current value of replacement

587
588
589
# File 'lib/rspec/core/notifications.rb', line 587
def replacement
  @replacement
end

Class Method Details

+ (void) from_hash(data)

Convenience way to initialize the notification

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