Class: Remarkable::Controller::Matchers::RespondWith

Inherits:
Matcher::Base
  • Object
show all
Defined in:
lib/remarkable/controller/macros/respond_with_matcher.rb

Instance Method Summary collapse

Methods inherited from Matcher::Base

#negative, #negative_failure_message, #spec

Methods included from Matcher::DSL

included

Constructor Details

#initialize(type) ⇒ RespondWith

Returns a new instance of RespondWith.



5
6
7
# File 'lib/remarkable/controller/macros/respond_with_matcher.rb', line 5

def initialize(type)
  @type = type
end

Instance Method Details

#descriptionObject



19
20
21
# File 'lib/remarkable/controller/macros/respond_with_matcher.rb', line 19

def description
  expectation
end

#failure_messageObject



23
24
25
# File 'lib/remarkable/controller/macros/respond_with_matcher.rb', line 23

def failure_message
  @missing
end

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
# File 'lib/remarkable/controller/macros/respond_with_matcher.rb', line 9

def matches?(subject)
  @subject = subject

  initialize_with_spec!

  assert_matcher do
    respond_with_type?
  end
end