module Line::Message::RSpec::Matchers
Public Instance Methods
Source
# File lib/line/message/rspec/matchers/have_flex_component.rb, line 76 def have_line_flex_box(**options) # rubocop:disable Naming/PredicatePrefix options = Utils.stringify_keys!(options, deep: true) HaveFlexComponent.new(expected_desc: "box(#{options.inspect})") do |content| next false unless content["type"] == "box" ::RSpec::Matchers::BuiltIn::Include.new(options).matches?(content) end end
Source
# File lib/line/message/rspec/matchers/have_flex_bubble.rb, line 54 def have_line_flex_bubble(expected = nil) # rubocop:disable Naming/PredicatePrefix HaveFlexBubble.new(expected) end
Source
# File lib/line/message/rspec/matchers/have_flex_component.rb, line 72 def have_line_flex_component(&) # rubocop:disable Naming/PredicatePrefix HaveFlexComponent.new(&) end
Source
# File lib/line/message/rspec/matchers/have_flex_component.rb, line 109 def have_line_flex_image(url, **options) # rubocop:disable Naming/PredicatePrefix options = Utils.stringify_keys!(options, deep: true) HaveFlexComponent.new(expected_desc: "image(#{url.inspect})") do |content| next false unless content["type"] == "image" ::RSpec::Matchers::BuiltIn::Include.new({ "url" => url, **options }).matches?(content) end end
Source
# File lib/line/message/rspec/matchers/have_flex_message.rb, line 40 def have_line_flex_message(expected = nil) # rubocop:disable Naming/PredicatePrefix HaveFlexMessage.new(expected) end
Source
# File lib/line/message/rspec/matchers/have_flex_separator.rb, line 8 def have_line_flex_separator(**options) # rubocop:disable Naming/PredicatePrefix options = Utils.stringify_keys!(options, deep: true) HaveFlexComponent.new(expected_desc: "separator(#{options.inspect})") do |content| next false unless content["type"] == "separator" options.empty? || ::RSpec::Matchers::BuiltIn::Include.new(options).matches?(content) end end
Source
# File lib/line/message/rspec/matchers/have_flex_component.rb, line 119 def have_line_flex_span(text, **options) # rubocop:disable Naming/PredicatePrefix options = Utils.stringify_keys!(options, deep: true) HaveFlexComponent.new(expected_desc: "span(#{text.inspect})") do |content| next false unless content["type"] == "span" content["text"].match?(text) && ::RSpec::Matchers::BuiltIn::Include.new(options).matches?(content) end end
Source
# File lib/line/message/rspec/matchers/have_flex_component.rb, line 86 def have_line_flex_text(text, **options) # rubocop:disable Naming/PredicatePrefix options = Utils.stringify_keys!(options, deep: true) HaveFlexComponent.new(expected_desc: "text(#{text.inspect})") do |content| next false unless content["type"] == "text" content["text"].match?(text) && ::RSpec::Matchers::BuiltIn::Include.new(options).matches?(content) end end
Source
# File lib/line/message/rspec/matchers/have_quick_reply.rb, line 47 def have_line_quick_reply(expected = nil) # rubocop:disable Naming/PredicatePrefix HaveQuickReply.new(expected) end
Source
# File lib/line/message/rspec/matchers/have_text_message.rb, line 41 def have_line_text_message(*expected) # rubocop:disable Naming/PredicatePrefix HaveTextMessage.new(expected) end