capybara-json 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -2
- data/.rvmrc +0 -0
- data/.rvmrc.capybara.lt.1.0 +1 -0
- data/.travis.yml +2 -2
- data/CHANGELOG.md +7 -0
- data/README.md +7 -3
- data/Rakefile +8 -0
- data/VERSION +1 -1
- data/capybara-json.gemspec +2 -1
- data/lib/capybara/json.rb +5 -1
- data/lib/capybara/rack_test_json/driver.rb +3 -2
- metadata +27 -14
data/.gitignore
CHANGED
data/.rvmrc
CHANGED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
rvm gemset use capybara.lt.1.0-json
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
# capybara-json
|
1
|
+
# capybara-json [![Build Status](https://secure.travis-ci.org/okitan/capybara-json.png)](http://travis-ci.org/okitan/capybara-json)
|
2
|
+
|
3
|
+
testing ruby: 1.9.2, 1.9.3 and ruby-head; Capybara: < 1.0 and > 1.0
|
4
|
+
|
5
|
+
## About capybara-json
|
2
6
|
|
3
7
|
capybara-json provides the same interface to testing JSON API (both local and remote)
|
4
8
|
|
@@ -18,9 +22,9 @@ testing web application
|
|
18
22
|
|
19
23
|
* 0.0.1
|
20
24
|
* create :rack_test_json driver which supports normal json response (2xx, 3xx)
|
21
|
-
* 0.0.2
|
22
|
-
* create :httpclient driver for remote testing
|
23
25
|
* 0.0.3
|
26
|
+
* create :httpclient driver for remote testing
|
27
|
+
* 0.0.4
|
24
28
|
* create :httpclient_json driver with the same interface with :rack_test_json in normal json response
|
25
29
|
* 0.1.0
|
26
30
|
* ensure :rack_test_json and :httpclient_json has the same interface in error response (4xx, 5xx)
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/capybara-json.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.version = File.read(File.expand_path('VERSION', File.dirname(__FILE__))).chomp
|
5
5
|
s.authors = ["okitan"]
|
6
6
|
s.email = ["okitakunio@gmail.com"]
|
7
|
-
s.homepage = ""
|
7
|
+
s.homepage = "http://github.com/okitan/capybara-json"
|
8
8
|
s.summary = %q{for testing json-api with capybara}
|
9
9
|
s.description = %q{for testing json-api with capybara}
|
10
10
|
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
[ 'sinatra' ],
|
26
26
|
[ 'yajl-ruby' ],
|
27
27
|
[ 'autowatchr' ],
|
28
|
+
[ 'rake' ],
|
28
29
|
].each do |gem, version|
|
29
30
|
s.add_development_dependency gem, version
|
30
31
|
end
|
data/lib/capybara/json.rb
CHANGED
@@ -3,8 +3,12 @@ require 'capybara/dsl'
|
|
3
3
|
|
4
4
|
module Capybara
|
5
5
|
module Json
|
6
|
+
def self.to_include
|
7
|
+
Capybara.const_defined?("DSL") ? Capybara::DSL : Capybara
|
8
|
+
end
|
9
|
+
|
6
10
|
def self.included(base)
|
7
|
-
base.__send__(:include,
|
11
|
+
base.__send__(:include, to_include) unless base < to_include
|
8
12
|
base.extend(self)
|
9
13
|
end
|
10
14
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'multi_json'
|
2
2
|
|
3
|
-
|
3
|
+
to_inherit = Capybara.const_defined?("RackTest") ? Capybara::RackTest::Driver : Capybara::Driver::RackTest
|
4
|
+
|
5
|
+
class Capybara::RackTestJson::Driver < to_inherit
|
4
6
|
def body
|
5
7
|
MultiJson.decode(source) || {}
|
6
8
|
end
|
7
|
-
|
8
9
|
|
9
10
|
%w[ post put ].each do |method|
|
10
11
|
class_eval %{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
16
|
-
requirement: &
|
16
|
+
requirement: &74974930 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *74974930
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: multi_json
|
27
|
-
requirement: &
|
27
|
+
requirement: &74974650 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *74974650
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &74974100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.8.0.rc
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *74974100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sinatra
|
49
|
-
requirement: &
|
49
|
+
requirement: &74956960 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *74956960
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: yajl-ruby
|
60
|
-
requirement: &
|
60
|
+
requirement: &74956500 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *74956500
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: autowatchr
|
71
|
-
requirement: &
|
71
|
+
requirement: &74956200 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,18 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *74956200
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rake
|
82
|
+
requirement: &74955670 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *74955670
|
80
91
|
description: for testing json-api with capybara
|
81
92
|
email:
|
82
93
|
- okitakunio@gmail.com
|
@@ -87,7 +98,9 @@ files:
|
|
87
98
|
- .gitignore
|
88
99
|
- .rspec
|
89
100
|
- .rvmrc
|
101
|
+
- .rvmrc.capybara.lt.1.0
|
90
102
|
- .travis.yml
|
103
|
+
- CHANGELOG.md
|
91
104
|
- Gemfile
|
92
105
|
- Gemfile.capybara.lt.1.0
|
93
106
|
- README.md
|
@@ -103,7 +116,7 @@ files:
|
|
103
116
|
- spec/spec_helper.rb
|
104
117
|
- spec/support/driver_examples.rb
|
105
118
|
- spec/support/json_test_app.rb
|
106
|
-
homepage:
|
119
|
+
homepage: http://github.com/okitan/capybara-json
|
107
120
|
licenses: []
|
108
121
|
post_install_message:
|
109
122
|
rdoc_options: []
|