apirunner 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/apirunner.gemspec +2 -2
- data/lib/api_runner.rb +1 -1
- data/lib/http_client.rb +1 -1
- data/lib/plugins/plug03_response_header_checker.rb +1 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
data/apirunner.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{apirunner}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["jan@moviepilot.com"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-28}
|
13
13
|
s.description = %q{apirunner is a testsuite to query your RESTful JSON API and match response with your defined expectations}
|
14
14
|
s.email = %q{developers@moviepilot.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/api_runner.rb
CHANGED
@@ -96,7 +96,7 @@ class ApiRunner
|
|
96
96
|
# loads and parses items that need to be excluded from the checks in certain environments
|
97
97
|
def load_excludes(env)
|
98
98
|
excludes_file = self.class.excludes_file
|
99
|
-
@excludes = YAML.load_file(excludes_file).detect{ |a| a.first == env.to_s }[1]["excludes"] rescue nil
|
99
|
+
@excludes = YAML.load_file(excludes_file).detect{ |a| a.first == env.to_s }[1]["excludes"].map{ |x| x.downcase } rescue nil
|
100
100
|
end
|
101
101
|
|
102
102
|
# returns config files path and can be stubbed this way
|
data/lib/http_client.rb
CHANGED
@@ -26,7 +26,7 @@ class HttpClient
|
|
26
26
|
response.code = raw_response.code
|
27
27
|
response.message = raw_response.message
|
28
28
|
response.body = raw_response.body
|
29
|
-
response.headers = raw_response.to_hash.keys.inject({}){|hash, key| hash[key] = raw_response.to_hash[key][0]; hash}
|
29
|
+
response.headers = raw_response.to_hash.keys.inject({}){|hash, key| hash[key.to_s.downcase] = raw_response.to_hash[key][0]; hash}
|
30
30
|
response.runtime = runtime
|
31
31
|
response.fully_qualified_path = (method == "GET" ? build_uri(resource, params).request_uri : resource_path(resource))
|
32
32
|
response
|
@@ -5,6 +5,7 @@ class ResponseHeaderChecker < Checker
|
|
5
5
|
result = Result.new(@testcase, @response)
|
6
6
|
begin
|
7
7
|
@testcase.response_expectation['headers'].each_pair do |header_name, header_value|
|
8
|
+
header_name = header_name.downcase
|
8
9
|
if is_regex?(header_value)
|
9
10
|
if not (excluded?(header_name) or regex_matches?(header_value, @response.headers[header_name]))
|
10
11
|
result.succeeded = false
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 8
|
9
|
+
version: 0.4.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jan@moviepilot.com
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-28 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -291,7 +291,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
291
291
|
requirements:
|
292
292
|
- - ">="
|
293
293
|
- !ruby/object:Gem::Version
|
294
|
-
hash:
|
294
|
+
hash: 2277206951597192754
|
295
295
|
segments:
|
296
296
|
- 0
|
297
297
|
version: "0"
|