Run tests only for the appropriate version of Capybara

This commit is contained in:
Dylan Lacey 2013-03-05 19:10:30 -08:00
parent 1c5f606974
commit 0beb2773ac
6 changed files with 43 additions and 4 deletions

View File

@ -7,7 +7,6 @@ gemspec
group :test do
gem 'cucumber'
gem 'rspec', '~> 2.12'
gem 'capybara', '~> 1.1.0'
gem 'jasmine', '~> 1.2.0.0'
end

17
Gemfile.capybara-1.x Normal file
View File

@ -0,0 +1,17 @@
source :gemcutter
gem 'rake'
gemspec
gem 'capybara', '~> 1.0.0'
group :test do
gem 'cucumber'
gem 'rspec', '~> 2.12'
gem 'jasmine', '~> 1.2.0.0'
end
group :development do
gem 'debugger', :platform => :mri_19
end

View File

@ -60,13 +60,13 @@ module Sauce
alias :base_within_frame :within_frame
alias :base_within_window :within_window
alias :base_find_window :find_window
alias :base_body :body
alias :base_source :source
#alias :base_body :body
#alias :base_source :source
alias :base_execute_script :execute_script
alias :base_evaluate_script :evaluate_script
[:find, :visit, :current_url, :reset!, :within_frame,
:within_window, :find_window, :body, :source,
:within_window, :find_window, :source,
:execute_script, :evaluate_script].each do |method|
define_method(method) do |*args, &block|
handle_retry(method, *args, &block)

View File

@ -42,6 +42,18 @@ describe Sauce::Capybara do
let(:app) { double('Mock App for Driver') }
let(:driver) { Sauce::Capybara::Driver.new(app) }
describe "#body", :capy_version => 1 do
it "should exist" do
driver.should respond_to :body
end
end
describe "#source", :capy_version => 1 do
it "should exist" do
driver.should respond_to :source
end
end
describe '#finish' do
let(:browser) { double('Sauce::Selenium2 mock') }

View File

@ -5,4 +5,12 @@ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
end
require 'sauce'
require 'capybara'
RSpec.configure do |c|
if Gem::Version.new(Capybara::VERSION) < Gem::Version.new(2)
c.filter_run_excluding :capy_version => 2
else
c.filter_run_excluding :capy_version => 1
end
end

3
travis.yml Normal file
View File

@ -0,0 +1,3 @@
gemfile:
- Gemfile
- Gemfile.capybara-1.x