From a4b694bd8c0a6ef4f5cdd2d2d6ce5c8017e3f945 Mon Sep 17 00:00:00 2001 From: Andrey Botalov Date: Thu, 3 Apr 2014 10:57:31 +0300 Subject: [PATCH] Allow to use markdown in yard docs and write better documentation for session's reset method --- Gemfile | 4 ++++ Rakefile | 2 +- gemfiles/Gemfile.base-versions | 1 - lib/capybara/session.rb | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 0bcd194ef..c2660fe92 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,7 @@ gem 'bundler', '~> 1.1' gemspec gem 'xpath', :git => 'git://github.com/jnicklas/xpath.git' + +group :doc do + gem 'redcarpet', :platforms => :mri +end diff --git a/Rakefile b/Rakefile index aa28656c9..224e5923b 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,7 @@ end YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb'] - #t.options = ['--any', '--extra', '--opts'] # optional + t.options = %w(--markup=markdown) end Cucumber::Rake::Task.new(:cucumber) do |task| diff --git a/gemfiles/Gemfile.base-versions b/gemfiles/Gemfile.base-versions index ed84e8527..036e04eda 100644 --- a/gemfiles/Gemfile.base-versions +++ b/gemfiles/Gemfile.base-versions @@ -9,7 +9,6 @@ gem 'rack', '= 1.3.0' # cannot go lower because referer tests need aa7ce77cd0 gem 'rack-test', '= 0.5.4' gem 'nokogiri', '= 1.3.3' gem 'rspec', '= 2.2.0' -gem 'fuubar', '>= 0.0.1' gem 'cucumber', '= 0.10.5' # We cannot test against older versions of selenium-webdriver without # installing older compatible Firefox versions. diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index 495935f34..1b2c16b18 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -73,7 +73,21 @@ def driver ## # - # Reset the session, removing all cookies. + # Reset the session (i.e. remove cookies and navigate to blank page) + # + # This method does not: + # + # * accept modal dialogs if they are present + # * clear browser cache/HTML 5 local storage/IndexedDB/Web SQL database/etc. + # * modify state of the driver/underlying browser in any other way + # + # as doing so will result in performance downsides and it's not needed to do everything from the list above for most apps. + # + # If you want to do anything from the list above on a general basis you can: + # + # * write RSpec/Cucumber/etc. after hook + # * monkeypatch this method + # * use Ruby's `prepend` method # def reset! if @touched