Class: RSpec::Rails::Matchers::RenderTemplate::RenderTemplateMatcher
- Inherits:
-
Matchers::BuiltIn::BaseMatcher
- Object
- Matchers::BuiltIn::BaseMatcher
- RSpec::Rails::Matchers::RenderTemplate::RenderTemplateMatcher
- Defined in:
- lib/rspec/rails/matchers/have_rendered.rb
Instance Method Summary (collapse)
- - (Object) failure_message_for_should private
- - (Object) failure_message_for_should_not private
-
- (RenderTemplateMatcher) initialize(scope, expected, message = nil)
constructor
A new instance of RenderTemplateMatcher.
- - (Boolean) matches? private
Constructor Details
- (RenderTemplateMatcher) initialize(scope, expected, message = nil)
Returns a new instance of RenderTemplateMatcher
5 6 7 8 9 |
# File 'lib/rspec/rails/matchers/have_rendered.rb', line 5 def initialize(scope, expected, =nil) @expected = Symbol === expected ? expected.to_s : expected @message = @scope = scope end |
Instance Method Details
- (Object) failure_message_for_should
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/rspec/rails/matchers/have_rendered.rb', line 19 def rescued_exception. end |
- (Object) failure_message_for_should_not
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/rspec/rails/matchers/have_rendered.rb', line 24 def "expected not to render #{expected.inspect}, but did" end |
- (Boolean) matches?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 |
# File 'lib/rspec/rails/matchers/have_rendered.rb', line 12 def matches?(*) match_unless_raises ActiveSupport::TestCase::Assertion do @scope.assert_template expected, @message end end |