Class: VRaptorMatchers::Render

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/vraptor/matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Render

Returns a new instance of Render.



22
23
24
# File 'lib/spec/vraptor/matchers.rb', line 22

def initialize(target)
  @target = "/#{target}"
end

Instance Method Details

#failure_messageObject



31
32
33
# File 'lib/spec/vraptor/matchers.rb', line 31

def failure_message
  "expected request to render #{@target}, is rendering #{@dispatcher.target}"
end

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/spec/vraptor/matchers.rb', line 26

def matches?(request)
  @dispatcher = request.dispatcher
  @dispatcher.target.eql? @target
end