Class: Remarkable::Controller::Matchers::SetSessionMatcher

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

Instance Method Summary collapse

Methods included from Default::Helpers

#assert_contains, #assert_does_not_contain

Methods inherited from Matcher::Base

#negative, #negative_failure_message, #spec

Methods included from Matcher::DSL

included

Constructor Details

#initialize(key, expected = nil, &block) ⇒ SetSessionMatcher

Returns a new instance of SetSessionMatcher.



7
8
9
10
11
# File 'lib/remarkable/controller/macros/set_session_matcher.rb', line 7

def initialize(key, expected=nil, &block)
  @key      = key
  @expected = expected
  @expected = block if block_given?
end

Instance Method Details

#descriptionObject



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

def description
  expectation
end

#failure_messageObject



27
28
29
# File 'lib/remarkable/controller/macros/set_session_matcher.rb', line 27

def failure_message
  @missing
end

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
21
# File 'lib/remarkable/controller/macros/set_session_matcher.rb', line 13

def matches?(subject)
  @subject = subject

  initialize_with_spec!

  assert_matcher do
    has_session_key?
  end
end