capybara-typhoeus 0.1.1 → 0.1.3
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.
- data/README.md +8 -24
- data/lib/capybara/driver/typhoeus_driver.rb +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -1,47 +1,31 @@
|
|
1
|
-
Capybara-
|
1
|
+
Capybara-typhoeus
|
2
2
|
==================
|
3
3
|
|
4
|
-
This gems makes it possible to use [
|
4
|
+
This gems makes it possible to use [Typhoeus](https://github.com/dbalatero/typhoeus) for remote testing.
|
5
5
|
|
6
6
|
This gem is a [Capybara](http://github.com/jnicklas/capybara) extension. The structure of the gem is taken from the work done on [Capybara-mechanize](http://github.com/jeroenvandijk/capybara-mechanize).
|
7
7
|
|
8
8
|
### Installation
|
9
9
|
|
10
|
-
gem install capybara-
|
10
|
+
gem install capybara-typhoeus
|
11
11
|
|
12
12
|
### Usage without Cucumber
|
13
13
|
|
14
|
-
require 'capybara/
|
14
|
+
require 'capybara/typhoeus'
|
15
15
|
|
16
16
|
### Usage with Cucumber and tags
|
17
17
|
|
18
|
-
A @
|
18
|
+
A @typhoeus tag is added to your hooks when you add the following line to your env.rb
|
19
19
|
|
20
|
-
require 'capybara/
|
20
|
+
require 'capybara/typhoeus/cucumber'
|
21
21
|
|
22
|
-
The following scenario will then be using the
|
22
|
+
The following scenario will then be using the Typhoeus driver
|
23
23
|
|
24
|
-
@
|
24
|
+
@typhoeus
|
25
25
|
Scenario: do something with the API
|
26
26
|
Given I send and accept JSON
|
27
27
|
When I send a GET request to /users
|
28
|
-
|
29
|
-
If you want to use a specific faraday supported adapter, you need to install the dependency and then specify the tag matching it:
|
30
28
|
|
31
|
-
To use Typhoeus
|
32
|
-
|
33
|
-
@faraday_typhoeus
|
34
|
-
Scenario: do something with the API
|
35
|
-
Given I send and accept JSON
|
36
|
-
When I send a GET request to /users
|
37
|
-
|
38
|
-
To use Patron
|
39
|
-
|
40
|
-
@faraday_patron
|
41
|
-
Scenario: do something with the API
|
42
|
-
Given I send and accept JSON
|
43
|
-
When I send a GET request to /users
|
44
|
-
|
45
29
|
### Remote testing
|
46
30
|
|
47
31
|
When you want to use this driver to test a remote application. You have to set the app_host:
|
@@ -127,7 +127,7 @@ class Capybara::Driver::Typhoeus < Capybara::Driver::Base
|
|
127
127
|
opts = {
|
128
128
|
:method => method,
|
129
129
|
:headers => headers.merge("Content-Type" => as, "Accept" => as),
|
130
|
-
:timeout =>
|
130
|
+
:timeout => 2000, # 2 seconds
|
131
131
|
}
|
132
132
|
opts[method==:get ? :params : :body] = params
|
133
133
|
request = Typhoeus::Request.new @current_uri, opts
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|
17
|
-
requirement: &
|
17
|
+
requirement: &2157319400 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.4.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157319400
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: typhoeus
|
28
|
-
requirement: &
|
28
|
+
requirement: &2157318920 !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: *
|
36
|
+
version_requirements: *2157318920
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: yajl-ruby
|
39
|
-
requirement: &
|
39
|
+
requirement: &2157318440 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: 0.8.2
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2157318440
|
48
48
|
description: Typhoeus driver for Capybara, allowing testing of REST APIs
|
49
49
|
email: joseph.halter@thetalentbox.com
|
50
50
|
executables: []
|