Module: ShowMeTheCookies

Defined in:
lib/show_me_the_cookies.rb,
lib/show_me_the_cookies/version.rb

Defined Under Namespace

Classes: Culerity, RackTest, Selenium

Constant Summary collapse

VERSION =
"0.2.2"

Instance Method Summary collapse

Instance Method Details

#current_driver_adapterObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/show_me_the_cookies.rb', line 7

def current_driver_adapter
  driver = Capybara.current_session.driver
  case Capybara.current_driver
  when :selenium
    ShowMeTheCookies::Selenium.new driver
  when :rack_test
    ShowMeTheCookies::RackTest.new driver
  when :culerity
    ShowMeTheCookies::Culerity.new driver
  else
    raise "unsupported driver, use rack::test, selenium/webdriver or culerity"
  end
end


25
26
27
28
29
30
# File 'lib/show_me_the_cookies.rb', line 25

def delete_cookie(cookie_name)
  announce current_driver_adapter.show_me_the_cookies if @announce
  current_driver_adapter.delete_cookie(cookie_name)
  announce "Deleted cookie: #{cookie_name}" if @announce
  announce current_driver_adapter.show_me_the_cookies if @announce
end

#show_me_the_cookiesObject



21
22
23
# File 'lib/show_me_the_cookies.rb', line 21

def show_me_the_cookies
  announce "Current cookies: #{current_driver_adapter.show_me_the_cookies}"
end