Class: Remarkable::Controller::Matchers::RenderWithLayout

Inherits:
Matcher::Base
  • Object
show all
Defined in:
lib/remarkable/controller/macros/render_with_layout_matcher.rb

Instance Method Summary collapse

Methods inherited from Matcher::Base

#negative, #negative_failure_message, #spec

Methods included from Matcher::DSL

included

Constructor Details

#initialize(expected_layout = 'application') ⇒ RenderWithLayout

Returns a new instance of RenderWithLayout.



5
6
7
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 5

def initialize(expected_layout = 'application')
  @expected_layout = expected_layout
end

Instance Method Details

#descriptionObject



23
24
25
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 23

def description
  expectation
end

#failure_messageObject



27
28
29
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 27

def failure_message
  @missing
end

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 9

def matches?(subject)
  @subject = subject

  initialize_with_spec!

  assert_matcher do
    if @expected_layout
      with_layout?
    else
      without_layout?
    end
  end
end