Class: Innate::Mock::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/innate/mock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

Returns a new instance of Session.



28
29
30
# File 'lib/innate/mock.rb', line 28

def initialize
  @cookie = nil
end

Instance Attribute Details

Returns the value of attribute cookie.



26
27
28
# File 'lib/innate/mock.rb', line 26

def cookie
  @cookie
end

Instance Method Details



38
39
40
41
42
43
44
45
46
# File 'lib/innate/mock.rb', line 38

def extract_cookie(method, path, hash = {})
  hash['HTTP_COOKIE'] ||= @cookie if @cookie
  response = Mock::mock(method, path, hash)

  cookie = response['Set-Cookie']
  @cookie = cookie if cookie

  response
end