Class: Line::Message::RSpec::Matchers::HaveQuickReply
- Inherits:
-
Object
- Object
- Line::Message::RSpec::Matchers::HaveQuickReply
- Defined in:
- lib/line/message/rspec/matchers/have_quick_reply.rb
Overview
The quick reply matcher for RSpec to search for quick reply action in the message array.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ HaveQuickReply
constructor
A new instance of HaveQuickReply.
- #matches?(actual) ⇒ Boolean (also: #==)
Constructor Details
#initialize(expected) ⇒ HaveQuickReply
Returns a new instance of HaveQuickReply.
10 11 12 |
# File 'lib/line/message/rspec/matchers/have_quick_reply.rb', line 10 def initialize(expected) @expected = Utils.stringify_keys!(expected, deep: true) end |
Instance Method Details
#description ⇒ Object
14 15 16 17 18 |
# File 'lib/line/message/rspec/matchers/have_quick_reply.rb', line 14 def description return "have quick reply action" if @expected.nil? "have quick reply action matching #{@expected}" end |
#failure_message ⇒ Object
26 27 28 |
# File 'lib/line/message/rspec/matchers/have_quick_reply.rb', line 26 def "expected to find a quick reply message matching #{@expected}" end |
#matches?(actual) ⇒ Boolean Also known as: ==
20 21 22 23 |
# File 'lib/line/message/rspec/matchers/have_quick_reply.rb', line 20 def matches?(actual) @actual = Utils.stringify_keys!(actual, deep: true) @actual.any? { || () } end |