apirunner 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +82 -2
- data/VERSION +1 -1
- data/apirunner.gemspec +1 -1
- data/lib/api_runner.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,9 +1,89 @@
|
|
1
1
|
= apirunner
|
2
2
|
|
3
|
-
|
3
|
+
*apirunner* let's you test your _JSON_ _API_ from the outside. Sometimes model-, controlle-r and routing-test's are not enough, you want to send requests to your application and validate the response in ganular detail. Then apirunner will be your best friend.
|
4
|
+
|
5
|
+
apirunner is no replacement to rspec or cucumber tests, nor does it replace webrat or capable tools like that. It's an addition that lets you query you API, specify your queries in detail, parse the expected response code, message, header and body and compare all (or any) of 'em to your expectation.
|
6
|
+
|
7
|
+
The request and expectation can (and have to be) written down in easily createable YAML Files. The provided expectation matchers can match strings, integers and regular expressions. So apirunner provides you with a simple but powerful tool to examine your api's bugs.
|
8
|
+
|
9
|
+
apirunner was initially developed for testing of the mighty (m8ty) i18n recommendation engine showcase of moviepilot.com (http://www.moviepilot.com) and extracted and gem'ified afterwards.
|
10
|
+
|
11
|
+
== Capabilities
|
12
|
+
|
13
|
+
*apirunner* *can*:
|
14
|
+
|
15
|
+
* be configured for as many environemnts as you wish (your local machine, you staging environment, your production boxes, your wifes handbag)
|
16
|
+
* send GET, POST, PUT and DELETE requests via HTTP
|
17
|
+
* read as many testcases as you wish from YAML files and execute them in the order of file appearance
|
18
|
+
* read more then one testcase from a file
|
19
|
+
* match the response code's of your applications responses
|
20
|
+
* match the syntactical correctnes of the response format (as long as it is JSON)
|
21
|
+
* proof the occurance and match the content of your app's HTTP header
|
22
|
+
* proof the occurence and match the content of your app's Body (as long as it responds JSON)
|
23
|
+
* optionally match only parts of header / body (you dont have to specify them in more detail than you are interested in)
|
24
|
+
* exclude certain value test's from certain environments (by reading excludes from excludes.yml)
|
25
|
+
* provide you with some nice feedback at the console .... yeah sexy dots (".") and fancy F's ("F") ....
|
26
|
+
* print out a nice error report (that you as a awesome ruby coder will never see)
|
27
|
+
* be invoked from within rake to generate some example configuration and testcase files
|
28
|
+
* be invoked also from within rake to run your test's
|
29
|
+
|
30
|
+
== Installation
|
31
|
+
|
32
|
+
gem install apirunner
|
33
|
+
|
34
|
+
== Configuration
|
35
|
+
|
36
|
+
rake api::scaffold
|
37
|
+
|
38
|
+
The latter one generates a starter configuration file in your config directory:
|
39
|
+
|
40
|
+
config/api_runner.yml
|
41
|
+
|
42
|
+
Additionally there will be some example testcases which can be found in:
|
43
|
+
|
44
|
+
test/apirunner/001_create_ressource.yml
|
45
|
+
test/apirunner/002_delete_ressource.yml
|
46
|
+
test/apirunner/excludes.yml
|
47
|
+
|
48
|
+
== Invocation
|
49
|
+
|
50
|
+
Assuming you defined an environment "local" and "staging" you can invoke your masterpiece with:
|
51
|
+
|
52
|
+
rake api:run:local
|
53
|
+
|
54
|
+
and
|
55
|
+
|
56
|
+
rake api:run:staging
|
57
|
+
|
58
|
+
== Testing
|
59
|
+
|
60
|
+
There are rspec model tests for all classes which can be invoked via:
|
61
|
+
|
62
|
+
rspec spec
|
63
|
+
|
64
|
+
== Dependencies
|
65
|
+
|
66
|
+
apirunner heavily depends on the following great GEM's:
|
67
|
+
|
68
|
+
1) nokogiri
|
69
|
+
2) httparty
|
70
|
+
|
71
|
+
== Authors
|
72
|
+
|
73
|
+
apirunner was written by:
|
74
|
+
|
75
|
+
*Jan* *Roesner* (http://railspotting.de) (jan@roesner.it)
|
76
|
+
|
77
|
+
for the great guy's at moviepilot.com (http://www.moviepilot.com)
|
78
|
+
|
79
|
+
With support from:
|
80
|
+
|
81
|
+
*Daniel* *Bornkessel* (daniel@moviepilot.com)
|
82
|
+
|
83
|
+
and the *moviepilot* *dev-team* (developers@moviepilot.com)
|
4
84
|
|
5
85
|
== Note on Patches/Pull Requests
|
6
|
-
|
86
|
+
|
7
87
|
* Fork the project.
|
8
88
|
* Make your feature addition or bug fix.
|
9
89
|
* Add tests for it. This is important so I don't break it in a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/apirunner.gemspec
CHANGED
data/lib/api_runner.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- moviepilot
|
@@ -245,7 +245,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
245
245
|
requirements:
|
246
246
|
- - ">="
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
hash: -
|
248
|
+
hash: -1083630349754663416
|
249
249
|
segments:
|
250
250
|
- 0
|
251
251
|
version: "0"
|