Class: Shoulda::ActionController::Matchers::RenderWithLayout
- Inherits:
-
Object
- Object
- Shoulda::ActionController::Matchers::RenderWithLayout
- Defined in:
- lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(layout) ⇒ RenderWithLayout
constructor
A new instance of RenderWithLayout.
- #matches?(controller) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(layout) ⇒ RenderWithLayout
Returns a new instance of RenderWithLayout.
18 19 20 |
# File 'lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb', line 18 def initialize(layout) @layout = layout.to_s unless layout.nil? end |
Instance Method Details
#description ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb', line 35 def description description = "render with " if @layout.nil? description << "a layout" else description << "the #{@layout.inspect} layout" end description end |
#failure_message ⇒ Object
27 28 29 |
# File 'lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb', line 27 def "Expected #{expectation}, but #{result}" end |
#matches?(controller) ⇒ Boolean
22 23 24 25 |
# File 'lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb', line 22 def matches?(controller) @controller = controller rendered_with_layout? && rendered_with_expected_layout? end |
#negative_failure_message ⇒ Object
31 32 33 |
# File 'lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb', line 31 def "Did not expect #{expectation}, but #{result}" end |