Added commented out integration specs

This commit is contained in:
Joe Ferris 2011-02-26 17:02:00 -05:00
parent 69ef4e73dc
commit 7451010c18
7 changed files with 51 additions and 2 deletions

View File

@ -2,4 +2,5 @@ source "http://rubygems.org"
gem "rake"
gem "rspec", :require => false
gem "capybara"
gem "sinatra", :require => false

View File

@ -38,6 +38,10 @@ GEM
ffi (~> 0.6.3)
json_pure
rubyzip
sinatra (1.1.2)
rack (~> 1.1)
tilt (~> 1.2)
tilt (1.2.2)
xpath (0.1.3)
nokogiri (~> 1.3)
@ -48,3 +52,4 @@ DEPENDENCIES
capybara
rake
rspec
sinatra

View File

@ -56,7 +56,7 @@ task :build => :qmake do
end
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/*_spec.rb"
t.pattern = "spec/{*_spec.rb,**/*_spec.rb}"
t.rspec_opts = "--format progress"
end

View File

@ -33,7 +33,7 @@ class Capybara::Driver::Webkit
@socket.puts name
@socket.puts args.size
args.each do |arg|
@socket.puts arg.bytesize
@socket.puts arg.to_s.bytesize
@socket.print arg
end
check

View File

@ -0,0 +1,22 @@
require 'spec_helper'
require 'capybara/driver/webkit'
describe Capybara::Driver::Webkit do
before do
@driver = Capybara::Driver::Webkit.new(TestApp)
end
# TODO: select options
# it_should_behave_like "driver"
# TODO: bug with drag and drop
# it_should_behave_like "driver with javascript support"
# TODO: needs to reset cookies after each test
# it_should_behave_like "driver with cookies support"
# Can't support:
# it_should_behave_like "driver with header support"
# it_should_behave_like "driver with status code support"
# it_should_behave_like "driver with frame support"
end

View File

@ -0,0 +1,12 @@
require 'spec_helper'
require 'capybara-webkit'
describe Capybara::Session do
before do
@session = Capybara::Session.new(:webkit, TestApp)
end
# TODO: needs to only use one Browser throughout tests
# it_should_behave_like "session"
# it_should_behave_like "session with javascript support"
end

View File

@ -8,3 +8,12 @@ ENV["PATH"] = ENV["PATH"] + ":" + File.join(PROJECT_ROOT, "bin")
Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
spec_dir = nil
$:.detect do |dir|
if File.exists? File.join(dir, "capybara.rb")
spec_dir = File.expand_path(File.join(dir,"..","spec"))
$:.unshift( spec_dir )
end
end
require File.join(spec_dir,"spec_helper")