class Line::Message::RSpec::Matchers::HaveFlexBubble
The flex component matcher for RSpec to search nested flex components in the message array.
Public Class Methods
Source
# File lib/line/message/rspec/matchers/have_flex_bubble.rb, line 10 def initialize(expected) @expected = Utils.stringify_keys!(expected || {}, deep: true) end
Public Instance Methods
Source
# File lib/line/message/rspec/matchers/have_flex_bubble.rb, line 14 def description return "have flex bubble" if @expected.empty? "have flex bubble matching #{@expected.inspect}" end
Source
# File lib/line/message/rspec/matchers/have_flex_bubble.rb, line 26 def failure_message return "expected to find a flex bubble" if @expected.empty? "expected to find a flex bubble matching #{@expected.inspect}" end
Source
# File lib/line/message/rspec/matchers/have_flex_bubble.rb, line 20 def matches?(actual) @actual = Utils.stringify_keys!(actual, deep: true) @actual.any? { |message| match_flex_component?(message) } end
Also aliased as: ==