class Matchers::HTTP::ResponseBodyContains

Public Class Methods

new(search_term) click to toggle source

@param search_term [String | Regexp] - the search term

# File lib/matchers/http/response_body_contains.rb, line 13
def initialize(search_term)
  @search_term = search_term
end

Public Instance Methods

matches?(body_s) click to toggle source

@param body_s [String] - the http response body

# File lib/matchers/http/response_body_contains.rb, line 18
def matches?(body_s)
  return @search_term.match(body_s) if @search_term.class == Regexp
  body_s.include?(@search_term)
end