apirunner 0.4.4 → 0.4.5
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.
- data/VERSION +1 -1
- data/apirunner.gemspec +1 -1
- data/lib/plugins/plug04_response_body_checker.rb +4 -1
- data/spec/response_body_checker_spec.rb +2 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.5
|
data/apirunner.gemspec
CHANGED
@@ -86,6 +86,9 @@ class ResponseBodyChecker < Checker
|
|
86
86
|
# returns relative path for matching the target tree of the response body
|
87
87
|
# explicit array adressing is replaced by *
|
88
88
|
def relative_path(path)
|
89
|
-
path
|
89
|
+
# replace array referenced IN the path
|
90
|
+
first_pass = path.gsub(/\/([^\/]+)\[\d+\]\//i,"/*/")
|
91
|
+
# replace array references AT THE END of the path too
|
92
|
+
first_pass.gsub(/\/([^\/]+)\[\d+\]$/,"/*")
|
90
93
|
end
|
91
94
|
end
|
@@ -10,7 +10,8 @@ describe "ResponseBodyChecker" do
|
|
10
10
|
path = "/bla/foo/values[6]/duffy/friends[1]/duck"
|
11
11
|
ResponseBodyChecker.new({},{}).send(:relative_path, path).should eql "/bla/foo/*/duffy/*/duck"
|
12
12
|
end
|
13
|
-
it "should
|
13
|
+
it "should substiture at the end of the path too" do
|
14
|
+
# pending "Had to revert the code change, caused a bug in tree parsing"
|
14
15
|
path = "/bla/foo/values[6]/duffy/friends[1]/duck/ibizas[7]"
|
15
16
|
ResponseBodyChecker.new({}, {}).send(:relative_path, path).should eql "/bla/foo/*/duffy/*/duck/*"
|
16
17
|
end
|
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
|
+
- 5
|
9
|
+
version: 0.4.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jan@moviepilot.com
|
@@ -283,7 +283,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
283
283
|
requirements:
|
284
284
|
- - ">="
|
285
285
|
- !ruby/object:Gem::Version
|
286
|
-
hash: -
|
286
|
+
hash: -3546115168935278311
|
287
287
|
segments:
|
288
288
|
- 0
|
289
289
|
version: "0"
|