Class: RSpec::ActiveModelSerializers::Matchers::RenderSerializer::RenderSerializerMatcher
- Inherits:
-
Matchers::BuiltIn::BaseMatcher
- Object
- Matchers::BuiltIn::BaseMatcher
- RSpec::ActiveModelSerializers::Matchers::RenderSerializer::RenderSerializerMatcher
- Defined in:
- lib/rspec/active_model_serializers/matchers/render_serializer.rb
Instance Method Summary collapse
- #failure_message ⇒ Object private
- #failure_message_when_negated ⇒ Object private
-
#initialize(scope, expected, message = nil) ⇒ RenderSerializerMatcher
constructor
A new instance of RenderSerializerMatcher.
- #matches? ⇒ Boolean private
Constructor Details
#initialize(scope, expected, message = nil) ⇒ RenderSerializerMatcher
Returns a new instance of RenderSerializerMatcher.
10 11 12 13 14 |
# File 'lib/rspec/active_model_serializers/matchers/render_serializer.rb', line 10 def initialize(scope, expected, =nil) @expected = expected @message = @scope = scope end |
Instance Method Details
#failure_message ⇒ Object
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/active_model_serializers/matchers/render_serializer.rb', line 24 def rescued_exception. end |
#failure_message_when_negated ⇒ Object
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.
29 30 31 |
# File 'lib/rspec/active_model_serializers/matchers/render_serializer.rb', line 29 def "expected not to render #{expected.inspect}, but did" end |
#matches? ⇒ Boolean
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.
17 18 19 20 21 |
# File 'lib/rspec/active_model_serializers/matchers/render_serializer.rb', line 17 def matches?(*) match_unless_raises ActiveSupport::TestCase::Assertion do @scope.assert_serializer expected, @message end end |