kookaburra 0.18.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.18.1
1
+ 0.18.2
data/kookaburra.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "kookaburra"
8
- s.version = "0.18.1"
8
+ s.version = "0.18.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Wilger", "Sam Livingston-Gray", "Ravi Gadad"]
data/lib/kookaburra.rb CHANGED
@@ -98,7 +98,9 @@ class Kookaburra
98
98
  end
99
99
 
100
100
  def application_driver
101
- RackDriver.new(@rack_app)
101
+ unless @rack_app.nil?
102
+ RackDriver.new(@rack_app)
103
+ end
102
104
  end
103
105
 
104
106
  def test_data
@@ -2,26 +2,47 @@ require 'kookaburra'
2
2
 
3
3
  describe Kookaburra do
4
4
  describe '#given' do
5
- it 'returns an instance of the configured GivenDriver' do
6
- Kookaburra::RackDriver.should_receive(:new) \
7
- .with(:a_rack_app) \
8
- .and_return(:a_rack_driver)
5
+ context 'without a :rack_app specified' do
6
+ it 'returns an instance of the configured GivenDriver' do
7
+ my_api_driver_class = mock(Class)
8
+ my_api_driver_class.should_receive(:new) \
9
+ .with(nil) \
10
+ .and_return(:an_api_driver)
9
11
 
10
- my_api_driver_class = mock(Class)
11
- my_api_driver_class.should_receive(:new) \
12
- .with(:a_rack_driver) \
13
- .and_return(:an_api_driver)
12
+ my_given_driver_class = mock(Class)
13
+ my_given_driver_class.should_receive(:new) do |options|
14
+ options[:api].should == :an_api_driver
15
+ :a_given_driver
16
+ end
14
17
 
15
- my_given_driver_class = mock(Class)
16
- my_given_driver_class.should_receive(:new) do |options|
17
- options[:api].should == :an_api_driver
18
- :a_given_driver
18
+ k = Kookaburra.new(:given_driver_class => my_given_driver_class,
19
+ :api_driver_class => my_api_driver_class)
20
+ k.given.should == :a_given_driver
19
21
  end
22
+ end
23
+
24
+ context 'with a :rack_app specified' do
25
+ it 'returns an instance of the configured GivenDriver' do
26
+ Kookaburra::RackDriver.should_receive(:new) \
27
+ .with(:a_rack_app) \
28
+ .and_return(:a_rack_driver)
29
+
30
+ my_api_driver_class = mock(Class)
31
+ my_api_driver_class.should_receive(:new) \
32
+ .with(:a_rack_driver) \
33
+ .and_return(:an_api_driver)
20
34
 
21
- k = Kookaburra.new(:given_driver_class => my_given_driver_class,
22
- :api_driver_class => my_api_driver_class,
23
- :rack_app => :a_rack_app)
24
- k.given.should == :a_given_driver
35
+ my_given_driver_class = mock(Class)
36
+ my_given_driver_class.should_receive(:new) do |options|
37
+ options[:api].should == :an_api_driver
38
+ :a_given_driver
39
+ end
40
+
41
+ k = Kookaburra.new(:given_driver_class => my_given_driver_class,
42
+ :api_driver_class => my_api_driver_class,
43
+ :rack_app => :a_rack_app)
44
+ k.given.should == :a_given_driver
45
+ end
25
46
  end
26
47
  end
27
48
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kookaburra
3
3
  version: !ruby/object:Gem::Version
4
- hash: 85
4
+ hash: 83
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 18
9
- - 1
10
- version: 0.18.1
9
+ - 2
10
+ version: 0.18.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Wilger