Class: RSpec::SleepingKingStudios::Configuration::Examples
- Inherits:
-
Object
- Object
- RSpec::SleepingKingStudios::Configuration::Examples
- Defined in:
- lib/rspec/sleeping_king_studios/configuration.rb
Overview
Configuration options for RSpec::SleepingKingStudios::Examples.
Constant Summary collapse
- MISSING_FAILURE_MESSAGE_HANDLERS =
Permitted options for :handle_missing_failure_message_with.
%i[ignore pending exception].freeze
- STRING_FAILURE_MESSAGE_MATCH_OPTIONS =
Options for matching failure messages to strings.
%i[exact substring].freeze
Instance Method Summary collapse
-
#handle_missing_failure_message_with ⇒ Symbol
Gets the handler for missing failure messages when using the matcher examples, and sets to :pending if unset.
-
#handle_missing_failure_message_with=(value) ⇒ Object
Sets the handler for missing failure messages when using the matcher examples.
-
#match_string_failure_message_as ⇒ Symbol
Gets the option for matching failure messages to strings, and sets to :substring if unset.
-
#match_string_failure_message_as=(value) ⇒ Object
Sets the option for matching failure messages to strings.
Instance Method Details
#handle_missing_failure_message_with ⇒ Symbol
Gets the handler for missing failure messages when using the matcher examples, and sets to :pending if unset.
20 21 22 |
# File 'lib/rspec/sleeping_king_studios/configuration.rb', line 20 def @handle_missing_failure_message_with ||= :pending end |
#handle_missing_failure_message_with=(value) ⇒ Object
Sets the handler for missing failure messages when using the matcher examples.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rspec/sleeping_king_studios/configuration.rb', line 32 def value value = value.to_s.intern unless MISSING_FAILURE_MESSAGE_HANDLERS.include?(value) = "unrecognized handler value -- must be in #{MISSING_FAILURE_MESSAGE_HANDLERS.join ', '}" raise ArgumentError.new end # unless @handle_missing_failure_message_with = value end |
#match_string_failure_message_as ⇒ Symbol
Gets the option for matching failure messages to strings, and sets to :substring if unset.
48 49 50 |
# File 'lib/rspec/sleeping_king_studios/configuration.rb', line 48 def @match_string_failure_message_as ||= :substring end |
#match_string_failure_message_as=(value) ⇒ Object
Sets the option for matching failure messages to strings.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rspec/sleeping_king_studios/configuration.rb', line 59 def value value = value.to_s.intern value = :substring if value == :partial unless STRING_FAILURE_MESSAGE_MATCH_OPTIONS.include?(value) = "unrecognized value -- must be in #{STRING_FAILURE_MESSAGE_MATCH_OPTIONS.join ', '}" raise ArgumentError.new end # unless @match_string_failure_message_as = value end |