apirunner 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/apirunner.gemspec +1 -1
- data/examples/config/api_runner.yml +1 -1
- data/examples/test/api_runner/006_discovery.yml +109 -2
- data/lib/expectation_matcher.rb +0 -2
- data/lib/plugins/response_body_checker.rb +1 -0
- data/lib/result.rb +4 -4
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
data/apirunner.gemspec
CHANGED
@@ -57,12 +57,119 @@
|
|
57
57
|
response_expectation:
|
58
58
|
status_code: 404
|
59
59
|
body:
|
60
|
-
- name: "There should return recommendations / ratings for a discovery request for place_keyword:
|
60
|
+
- name: "There should return recommendations / ratings for a discovery request for place_keyword:200"
|
61
61
|
request:
|
62
62
|
headers:
|
63
63
|
Content-Type: 'application/json'
|
64
|
-
path: '/users/duffyduck/predictions/discovery/place_keyword:
|
64
|
+
path: '/users/duffyduck/predictions/discovery/place_keyword:200'
|
65
65
|
method: 'GET'
|
66
66
|
response_expectation:
|
67
67
|
status_code: 200
|
68
68
|
body: /^\[({"m\d+":[0-5]\.[05]},)+{"m\d+":[0-5]\.[05]}\]$/
|
69
|
+
- name: "There should return exactly 5 recommendations / ratings for a discovery request for place_keyword:200 with per_page 5"
|
70
|
+
request:
|
71
|
+
headers:
|
72
|
+
Content-Type: 'application/json'
|
73
|
+
path: '/users/duffyduck/predictions/discovery/place_keyword:200'
|
74
|
+
parameters:
|
75
|
+
per_page: 5
|
76
|
+
method: 'GET'
|
77
|
+
response_expectation:
|
78
|
+
status_code: 200
|
79
|
+
body: /^\[({"m\d+":[0-5]\.[05]},){4}{"m\d+":[0-5]\.[05]}\]$/
|
80
|
+
- name: "There should not return any recommendations / ratings on a dicovery request for place_keyword:200 for a non existing user"
|
81
|
+
request:
|
82
|
+
headers:
|
83
|
+
Content-Type: 'application/json'
|
84
|
+
path: '/users/daisyduck/predictions/discovery/place_keyword:200'
|
85
|
+
method: 'GET'
|
86
|
+
response_expectation:
|
87
|
+
status_code: 404
|
88
|
+
body:
|
89
|
+
- name: "There should return recommendations / ratings for a discovery request for time_keyword:198"
|
90
|
+
request:
|
91
|
+
headers:
|
92
|
+
Content-Type: 'application/json'
|
93
|
+
path: '/users/duffyduck/predictions/discovery/time_keyword:198'
|
94
|
+
method: 'GET'
|
95
|
+
response_expectation:
|
96
|
+
status_code: 200
|
97
|
+
body: /^\[({"m\d+":[0-5]\.[05]},)+{"m\d+":[0-5]\.[05]}\]$/
|
98
|
+
- name: "There should return exactly 5 recommendations / ratings for a discovery request for time_keyword:198 with per_page 5"
|
99
|
+
request:
|
100
|
+
headers:
|
101
|
+
Content-Type: 'application/json'
|
102
|
+
path: '/users/duffyduck/predictions/discovery/time_keyword:198'
|
103
|
+
parameters:
|
104
|
+
per_page: 5
|
105
|
+
method: 'GET'
|
106
|
+
response_expectation:
|
107
|
+
status_code: 200
|
108
|
+
body: /^\[({"m\d+":[0-5]\.[05]},){4}{"m\d+":[0-5]\.[05]}\]$/
|
109
|
+
- name: "There should not return any recommendations / ratings on a dicovery request for time_keyword:198 for a non existing user"
|
110
|
+
request:
|
111
|
+
headers:
|
112
|
+
Content-Type: 'application/json'
|
113
|
+
path: '/users/daisyduck/predictions/discovery/place_keyword:198'
|
114
|
+
method: 'GET'
|
115
|
+
response_expectation:
|
116
|
+
status_code: 404
|
117
|
+
body:
|
118
|
+
- name: "There should return recommendations / ratings for a discovery request for emotion_keyword:12"
|
119
|
+
request:
|
120
|
+
headers:
|
121
|
+
Content-Type: 'application/json'
|
122
|
+
path: '/users/duffyduck/predictions/discovery/emotion_keyword:12'
|
123
|
+
method: 'GET'
|
124
|
+
response_expectation:
|
125
|
+
status_code: 200
|
126
|
+
body: /^\[({"m\d+":[0-5]\.[05]},)+{"m\d+":[0-5]\.[05]}\]$/
|
127
|
+
- name: "There should return exactly 5 recommendations / ratings for a discovery request for emotion_keyword:12 with per_page 5"
|
128
|
+
request:
|
129
|
+
headers:
|
130
|
+
Content-Type: 'application/json'
|
131
|
+
path: '/users/duffyduck/predictions/discovery/emotion_keyword:12'
|
132
|
+
parameters:
|
133
|
+
per_page: 5
|
134
|
+
method: 'GET'
|
135
|
+
response_expectation:
|
136
|
+
status_code: 200
|
137
|
+
body: /^\[({"m\d+":[0-5]\.[05]},){4}{"m\d+":[0-5]\.[05]}\]$/
|
138
|
+
- name: "There should not return any recommendations / ratings on a dicovery request for emotion_keyword:12 for a non existing user"
|
139
|
+
request:
|
140
|
+
headers:
|
141
|
+
Content-Type: 'application/json'
|
142
|
+
path: '/users/daisyduck/predictions/discovery/emotion_keyword:12'
|
143
|
+
method: 'GET'
|
144
|
+
response_expectation:
|
145
|
+
status_code: 404
|
146
|
+
body:
|
147
|
+
- name: "There should return recommendations / ratings for a discovery request for intended_audience:13"
|
148
|
+
request:
|
149
|
+
headers:
|
150
|
+
Content-Type: 'application/json'
|
151
|
+
path: '/users/duffyduck/predictions/discovery/intended_audience:13'
|
152
|
+
method: 'GET'
|
153
|
+
response_expectation:
|
154
|
+
status_code: 200
|
155
|
+
body: /^\[({"m\d+":[0-5]\.[05]},)+{"m\d+":[0-5]\.[05]}\]$/
|
156
|
+
- name: "There should return exactly 5 recommendations / ratings for a discovery request for intended_audience:13 with per_page 5"
|
157
|
+
request:
|
158
|
+
headers:
|
159
|
+
Content-Type: 'application/json'
|
160
|
+
path: '/users/duffyduck/predictions/discovery/intended_audience:13'
|
161
|
+
parameters:
|
162
|
+
per_page: 5
|
163
|
+
method: 'GET'
|
164
|
+
response_expectation:
|
165
|
+
status_code: 200
|
166
|
+
body: /^\[({"m\d+":[0-5]\.[05]},){4}{"m\d+":[0-5]\.[05]}\]$/
|
167
|
+
- name: "There should not return any recommendations / ratings on a dicovery request for intended_audience:13 for a non existing user"
|
168
|
+
request:
|
169
|
+
headers:
|
170
|
+
Content-Type: 'application/json'
|
171
|
+
path: '/users/daisyduck/predictions/discovery/intended_audience:13'
|
172
|
+
method: 'GET'
|
173
|
+
response_expectation:
|
174
|
+
status_code: 404
|
175
|
+
body:
|
data/lib/expectation_matcher.rb
CHANGED
data/lib/result.rb
CHANGED
@@ -20,7 +20,7 @@ class Result
|
|
20
20
|
# yields out rspec like error messages only in case of an error
|
21
21
|
def rspec(index)
|
22
22
|
if not @succeeded
|
23
|
-
puts "\
|
23
|
+
puts "\n\033[31mError\033[0m (#{index}) - \"#{@testcase.name}\""
|
24
24
|
puts @error_message
|
25
25
|
end
|
26
26
|
end
|
@@ -43,7 +43,7 @@ class Result
|
|
43
43
|
|
44
44
|
# yields the verbose error messages
|
45
45
|
def be_verbose(index)
|
46
|
-
puts "\n#{result_case} (#{index+1})
|
46
|
+
puts "\n#{result_case} (#{index+1})- \"#{@testcase.name}\""
|
47
47
|
puts @error_message
|
48
48
|
puts(" More more more verbosity\n")
|
49
49
|
puts(" request method: #{@testcase.request['method']}")
|
@@ -63,9 +63,9 @@ class Result
|
|
63
63
|
# returns the result case for interpolation in the output message header
|
64
64
|
def result_case
|
65
65
|
if @succeeded
|
66
|
-
"
|
66
|
+
"\033[32mSuccess\033[0m"
|
67
67
|
else
|
68
|
-
"
|
68
|
+
"\033[31mError\033[0m"
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 7
|
9
|
+
version: 0.2.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jan@moviepilot.com
|
@@ -277,7 +277,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
requirements:
|
278
278
|
- - ">="
|
279
279
|
- !ruby/object:Gem::Version
|
280
|
-
hash: -
|
280
|
+
hash: -704173494687780541
|
281
281
|
segments:
|
282
282
|
- 0
|
283
283
|
version: "0"
|