capybara-typhoeus 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ class Capybara::Driver::Typhoeus < Capybara::Driver::Base
7
7
  end
8
8
  end
9
9
 
10
- attr_writer :as, :with_headers, :with_params
10
+ attr_writer :as, :with_headers, :with_params, :with_options
11
11
  attr_reader :app, :rack_server, :options, :response
12
12
 
13
13
  def client
@@ -109,6 +109,7 @@ class Capybara::Driver::Typhoeus < Capybara::Driver::Base
109
109
  def reset_with!
110
110
  @with_headers = {}
111
111
  @with_params = {}
112
+ @with_options = {}
112
113
  end
113
114
 
114
115
  def as
@@ -123,6 +124,10 @@ class Capybara::Driver::Typhoeus < Capybara::Driver::Base
123
124
  @with_params ||= {}
124
125
  end
125
126
 
127
+ def with_options
128
+ @with_params ||= {}
129
+ end
130
+
126
131
  def process(method, path, params = {}, headers = {})
127
132
  @current_uri = url path
128
133
  opts = {
@@ -136,7 +141,7 @@ class Capybara::Driver::Typhoeus < Capybara::Driver::Base
136
141
  opts[:params] = with_params
137
142
  opts[:body] = params
138
143
  end
139
- request = Typhoeus::Request.new @current_uri, opts
144
+ request = Typhoeus::Request.new @current_uri, with_options.merge(opts)
140
145
  client.queue request
141
146
  client.run
142
147
  @response = request.response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-typhoeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-04-22 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
17
- requirement: &2166217820 !ruby/object:Gem::Requirement
17
+ requirement: &2164909020 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.1.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2166217820
25
+ version_requirements: *2164909020
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: typhoeus
28
- requirement: &2166217080 !ruby/object:Gem::Requirement
28
+ requirement: &2164908340 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.2.4
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2166217080
36
+ version_requirements: *2164908340
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: yajl-ruby
39
- requirement: &2166216580 !ruby/object:Gem::Requirement
39
+ requirement: &2164907560 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2166216580
47
+ version_requirements: *2164907560
48
48
  description: Typhoeus driver for Capybara, allowing testing of REST APIs
49
49
  email: joseph.halter@thetalentbox.com
50
50
  executables: []