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 +1 -1
- data/kookaburra.gemspec +1 -1
- data/lib/kookaburra.rb +3 -1
- data/spec/kookaburra_spec.rb +37 -16
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.18.
|
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.
|
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
data/spec/kookaburra_spec.rb
CHANGED
@@ -2,26 +2,47 @@ require 'kookaburra'
|
|
2
2
|
|
3
3
|
describe Kookaburra do
|
4
4
|
describe '#given' do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
.
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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:
|
4
|
+
hash: 83
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 18
|
9
|
-
-
|
10
|
-
version: 0.18.
|
9
|
+
- 2
|
10
|
+
version: 0.18.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Wilger
|