Module: Remarkable::Messages
- Included in:
- Base
- Defined in:
- lib/remarkable/messages.rb
Overview
Holds the methods required by rspec for each matcher plus a collection of helpers to deal with I18n.
Instance Method Summary collapse
-
#description(options = {}) ⇒ Object
Provides a default description message.
-
#failure_message_for_should ⇒ Object
(also: #failure_message)
Provides a default failure message.
-
#failure_message_for_should_not ⇒ Object
(also: #negative_failure_message)
Provides a default negative failure message.
Instance Method Details
#description(options = {}) ⇒ Object
Provides a default description message. Overwrite it if needed. By default it uses default i18n options, but without the subjects, which usually are not available when description is called.
11 12 13 14 15 16 17 18 19 |
# File 'lib/remarkable/messages.rb', line 11 def description(={}) = .merge() # Remove subject keys .delete(:subject_name) .delete(:subject_inspect) Remarkable.t 'description', end |
#failure_message_for_should ⇒ Object Also known as: failure_message
Provides a default failure message. Overwrite it if needed.
23 24 25 |
# File 'lib/remarkable/messages.rb', line 23 def Remarkable.t 'remarkable.core.failure_message_for_should', :expectation => @expectation end |
#failure_message_for_should_not ⇒ Object Also known as: negative_failure_message
Provides a default negative failure message. Overwrite it if needed.
30 31 32 |
# File 'lib/remarkable/messages.rb', line 30 def Remarkable.t 'remarkable.core.failure_message_for_should_not', :expectation => @expectation end |