Class: UseLayout
- Inherits:
-
Object
- Object
- UseLayout
- Defined in:
- lib/objective_spec/matchers/use_layout_matcher.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ UseLayout
constructor
A new instance of UseLayout.
- #matches?(controller) ⇒ Boolean
- #negeative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ UseLayout
Returns a new instance of UseLayout.
4 5 6 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 4 def initialize(expected) @expected = 'layouts/' + expected end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
2 3 4 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 2 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
2 3 4 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 2 def expected @expected end |
Instance Method Details
#failure_message ⇒ Object
13 14 15 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 13 def return "use_layout expected #{@expected.inspect}, got #{@actual.inspect}" end |
#matches?(controller) ⇒ Boolean
8 9 10 11 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 8 def matches?(controller) @actual = controller.layout @actual == @expected end |
#negeative_failure_message ⇒ Object
17 18 19 |
# File 'lib/objective_spec/matchers/use_layout_matcher.rb', line 17 def return "use_layout expected #{@expected.inspect} not to equal #{@actual.inspect}" end |