Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
compare: f4e8c5dde2
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
2  VERSION
@@ -1 +1 @@
-0.18.1
+0.18.2
View
2  kookaburra.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = "kookaburra"
- s.version = "0.18.1"
+ s.version = "0.18.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["John Wilger", "Sam Livingston-Gray", "Ravi Gadad"]
View
4 lib/kookaburra.rb
@@ -98,7 +98,9 @@ def api
end
def application_driver
- RackDriver.new(@rack_app)
+ unless @rack_app.nil?
+ RackDriver.new(@rack_app)
+ end
end
def test_data
View
53 spec/kookaburra_spec.rb
@@ -2,26 +2,47 @@
describe Kookaburra do
describe '#given' do
- it 'returns an instance of the configured GivenDriver' do
- Kookaburra::RackDriver.should_receive(:new) \
- .with(:a_rack_app) \
- .and_return(:a_rack_driver)
+ context 'without a :rack_app specified' do
+ it 'returns an instance of the configured GivenDriver' do
+ my_api_driver_class = mock(Class)
+ my_api_driver_class.should_receive(:new) \
+ .with(nil) \
+ .and_return(:an_api_driver)
- my_api_driver_class = mock(Class)
- my_api_driver_class.should_receive(:new) \
- .with(:a_rack_driver) \
- .and_return(:an_api_driver)
+ my_given_driver_class = mock(Class)
+ my_given_driver_class.should_receive(:new) do |options|
+ options[:api].should == :an_api_driver
+ :a_given_driver
+ end
- my_given_driver_class = mock(Class)
- my_given_driver_class.should_receive(:new) do |options|
- options[:api].should == :an_api_driver
- :a_given_driver
+ k = Kookaburra.new(:given_driver_class => my_given_driver_class,
+ :api_driver_class => my_api_driver_class)
+ k.given.should == :a_given_driver
end
+ end
+
+ context 'with a :rack_app specified' do
+ it 'returns an instance of the configured GivenDriver' do
+ Kookaburra::RackDriver.should_receive(:new) \
+ .with(:a_rack_app) \
+ .and_return(:a_rack_driver)
+
+ my_api_driver_class = mock(Class)
+ my_api_driver_class.should_receive(:new) \
+ .with(:a_rack_driver) \
+ .and_return(:an_api_driver)
- k = Kookaburra.new(:given_driver_class => my_given_driver_class,
- :api_driver_class => my_api_driver_class,
- :rack_app => :a_rack_app)
- k.given.should == :a_given_driver
+ my_given_driver_class = mock(Class)
+ my_given_driver_class.should_receive(:new) do |options|
+ options[:api].should == :an_api_driver
+ :a_given_driver
+ end
+
+ k = Kookaburra.new(:given_driver_class => my_given_driver_class,
+ :api_driver_class => my_api_driver_class,
+ :rack_app => :a_rack_app)
+ k.given.should == :a_given_driver
+ end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.