Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
set up some basic strucutre for integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilger committed Mar 4, 2012
1 parent 8b0ef2c commit 6874f54
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--color
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
21 changes: 21 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/kookaburra.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Kookaburra
require 'kookaburra/api_driver'
require 'kookaburra/given_driver'
require 'kookaburra/ui_driver'

def initialize(params = {})
end
end
4 changes: 4 additions & 0 deletions lib/kookaburra/api_driver.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Kookaburra::APIDriver
def initialize(params = {})
end
end
4 changes: 4 additions & 0 deletions lib/kookaburra/given_driver.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Kookaburra::GivenDriver
def initialize(params = {})
end
end
4 changes: 4 additions & 0 deletions lib/kookaburra/ui_driver.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Kookaburra::UIDriver
def initialize(params = {})
end
end
16 changes: 14 additions & 2 deletions spec/kookaburra_integration_spec.rb
Original file line number Diff line number Diff line change
@@ -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')
Expand Down

0 comments on commit 6874f54

Please sign in to comment.