Class: ShowMeTheCookies::RackTest

Inherits:
Object
  • Object
show all
Defined in:
lib/show_me_the_cookies/rack_test.rb

Instance Method Summary collapse

Constructor Details

#initialize(rack_test_driver) ⇒ RackTest

Returns a new instance of RackTest.



2
3
4
# File 'lib/show_me_the_cookies/rack_test.rb', line 2

def initialize(rack_test_driver)
  @rack_test_driver = rack_test_driver
end

Instance Method Details



10
11
12
13
14
# File 'lib/show_me_the_cookies/rack_test.rb', line 10

def delete_cookie(cookie_name)
  cookie_jar.instance_variable_get(:@cookies).reject! do |existing_cookie|
    existing_cookie.name.downcase == cookie_name
  end
end

#show_me_the_cookiesObject



6
7
8
# File 'lib/show_me_the_cookies/rack_test.rb', line 6

def show_me_the_cookies
  cookie_jar.instance_variable_get(:@cookies).map(&:inspect).join("\n")
end