Class: Utensils::CustomMatchers::HaveImage
- Inherits:
-
Object
- Object
- Utensils::CustomMatchers::HaveImage
- Defined in:
- lib/utensils/custom_matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(image) ⇒ HaveImage
constructor
A new instance of HaveImage.
- #matches?(page) ⇒ Boolean
Constructor Details
#initialize(image) ⇒ HaveImage
Returns a new instance of HaveImage.
69 70 71 |
# File 'lib/utensils/custom_matchers.rb', line 69 def initialize(image) @image = image end |
Instance Method Details
#failure_message ⇒ Object
82 83 84 |
# File 'lib/utensils/custom_matchers.rb', line 82 def "expected html to contain image: #{@image.inspect}" end |
#failure_message_when_negated ⇒ Object
86 87 88 |
# File 'lib/utensils/custom_matchers.rb', line 86 def "expected html to not contain image: #{@image.inspect}" end |
#matches?(page) ⇒ Boolean
73 74 75 76 77 78 79 80 |
# File 'lib/utensils/custom_matchers.rb', line 73 def matches?(page) @page = page if @image.is_a?(String) find_by_url || find_lazy_loaded_image else find_dragonfly_image end end |