Permalink
Browse files

set up some basic strucutre for integration testing

  • Loading branch information...
1 parent 8b0ef2c commit 6874f5481caf06438af2c2597db36a9ab847cf01 @jwilger committed Feb 27, 2012
Showing with 57 additions and 2 deletions.
  1. +1 −0 .rspec
  2. +1 −0 Gemfile
  3. +21 −0 Gemfile.lock
  4. +8 −0 lib/kookaburra.rb
  5. +4 −0 lib/kookaburra/api_driver.rb
  6. +4 −0 lib/kookaburra/given_driver.rb
  7. +4 −0 lib/kookaburra/ui_driver.rb
  8. +14 −2 spec/kookaburra_integration_spec.rb
View
1 .rspec
@@ -0,0 +1 @@
+--color
View
@@ -8,6 +8,7 @@ gem 'rack-test'
# Include everything needed to run rake, tests, features, etc.
group :development do
gem 'rspec'
+ gem 'capybara'
gem 'yard'
gem 'redcarpet', '~> 1.0' # used to format documentation
gem 'jeweler'
View
@@ -4,14 +4,26 @@ GEM
activesupport (3.2.0)
i18n (~> 0.6)
multi_json (~> 1.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.3.1)
+ ffi (~> 1.0.6)
diff-lcs (1.1.3)
+ ffi (1.0.11)
git (1.2.5)
i18n (0.6.0)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
+ mime-types (1.17.2)
multi_json (1.0.4)
+ nokogiri (1.5.0)
rack (1.4.0)
rack-test (0.6.1)
rack (>= 1.0)
@@ -35,14 +47,23 @@ GEM
sexp_processor (~> 3.0)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
+ rubyzip (0.9.6.1)
+ selenium-webdriver (2.19.0)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0.9)
+ multi_json (~> 1.0.4)
+ rubyzip
sexp_processor (3.0.10)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
yard (0.7.4)
PLATFORMS
ruby
DEPENDENCIES
activesupport (>= 3.0)
+ capybara
i18n
jeweler
rack-test
View
@@ -0,0 +1,8 @@
+class Kookaburra
+ require 'kookaburra/api_driver'
+ require 'kookaburra/given_driver'
+ require 'kookaburra/ui_driver'
+
+ def initialize(params = {})
+ end
+end
@@ -0,0 +1,4 @@
+class Kookaburra::APIDriver
+ def initialize(params = {})
+ end
+end
@@ -0,0 +1,4 @@
+class Kookaburra::GivenDriver
+ def initialize(params = {})
+ end
+end
@@ -0,0 +1,4 @@
+class Kookaburra::UIDriver
+ def initialize(params = {})
+ end
+end
@@ -1,11 +1,23 @@
+require 'kookaburra'
+require 'rack'
+require 'capybara'
+
describe 'Kookaburra Integration' do
describe "testing a Rack application" do
describe "with an HTML interface" do
describe "with a JSON API" do
it "runs the tests against the app" do
- pending 'WIP' do
- k = Kookaburra.new(:given_driver => my_given_driver, :ui_driver => my_ui_driver)
+ my_api_driver_class = Class.new(Kookaburra::APIDriver)
+ my_given_driver_class = Class.new(Kookaburra::GivenDriver)
+ my_ui_driver_class = Class.new(Kookaburra::UIDriver)
+ my_app = Object.new
+ my_session = Capybara::Session.new(:javascript, my_app)
+ my_api_driver = my_api_driver_class.new(:app => my_app)
+ my_given_driver = my_given_driver_class.new(:api_driver => my_api_driver)
+ my_ui_driver = my_ui_driver_class.new(:session => my_session)
+ k = Kookaburra.new(:given_driver => my_given_driver, :ui_driver => my_ui_driver)
+ pending 'WIP' do
k.given.a_user(:bob)
k.given.a_widget(:widget_a)
k.given.a_widget(:widget_b, :name => 'Foo')

0 comments on commit 6874f54

Please sign in to comment.