api_pi 0.2.2 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +22 -7
- data/api_pi.gemspec +3 -2
- data/lib/api_pi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bb93d26d0c2c0268df45e1d0c7b65bfac8fa71c
|
4
|
+
data.tar.gz: 625d48a0cd5faa4c4c25d4ef2c0eb95954214edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d608c3bf845f9945b2904a12c22ac8c66b3213b794e090fd4b2b9d4c7728e0d36652a9d2c8594d25ef423f64bb952e0702a665ae9129bd059883133f150b2f30
|
7
|
+
data.tar.gz: 05181cb0c380d83d1fb509ec88ae90900abeb64edaff4c187e7ad250a1b5a06de4b7db4fb206d042a47ed66e6d95350d1aa6df6d5f0ac444bd723fedc7a87608
|
data/README.md
CHANGED
@@ -8,13 +8,9 @@ An example test can be found in the example/ directory.
|
|
8
8
|
|
9
9
|
Api P.I. requires ruby 2.0.0+
|
10
10
|
|
11
|
-
|
11
|
+
Install the gem:
|
12
12
|
|
13
|
-
$
|
14
|
-
|
15
|
-
Build and Install the gem:
|
16
|
-
|
17
|
-
$ gem build api_pi.gemspec && gem install api_pi-VERSION.gem
|
13
|
+
$ gem install api_pi
|
18
14
|
|
19
15
|
## Usage
|
20
16
|
|
@@ -25,7 +21,7 @@ request to a URL.
|
|
25
21
|
|
26
22
|
get "http://url-to-test.com/object.json" do...end
|
27
23
|
|
28
|
-
The `get` method takes a URL string and then
|
24
|
+
The `get` method takes a URL string and is then fed a block to build tests.
|
29
25
|
|
30
26
|
Once you GET your URL, you are ready to create test blocks.
|
31
27
|
|
@@ -187,6 +183,25 @@ is present in a JSON block:
|
|
187
183
|
"works".stripped? => true
|
188
184
|
" spaces ".stripped? => false
|
189
185
|
|
186
|
+
## Inspecting
|
187
|
+
|
188
|
+
To inspect your json:
|
189
|
+
|
190
|
+
# ruby inspect_myjson.rb
|
191
|
+
|
192
|
+
which would give you output similar to:
|
193
|
+
|
194
|
+
Requesting JSON from http://apipi.apiary.io/tests and testing
|
195
|
+
- headers
|
196
|
+
- body results.string
|
197
|
+
- results.int
|
198
|
+
- results
|
199
|
+
- results.array
|
200
|
+
|
201
|
+
5 tests, 5 succeeded, 0 failed
|
202
|
+
|
203
|
+
Passing tests yield a response code of 0, and failed tests yield 1.
|
204
|
+
|
190
205
|
## Testing
|
191
206
|
|
192
207
|
Api-PI is testing using Ruby's MiniTest framework. To run tests:
|
data/api_pi.gemspec
CHANGED
@@ -15,9 +15,10 @@ Gem::Specification.new do |g|
|
|
15
15
|
g.files = `git ls-files`.split("\n")
|
16
16
|
g.test_files = `git ls-files -- test/*`.split("\n")
|
17
17
|
|
18
|
-
g.extra_rdoc_files
|
18
|
+
g.extra_rdoc_files = ["README.md"]
|
19
|
+
g.required_ruby_version = '>= 2.0.0'
|
19
20
|
|
20
|
-
g.add_dependency
|
21
|
+
g.add_dependency 'map', '~> 6.5'
|
21
22
|
g.add_development_dependency 'webmock', '~> 1.17'
|
22
23
|
g.add_development_dependency 'rake', '~> 10.1'
|
23
24
|
end
|
data/lib/api_pi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Woodall
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
89
89
|
- - '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
91
|
+
version: 2.0.0
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '>='
|