webspicy 0.16.1 → 0.16.2
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 +2 -2
- data/examples/restful/Gemfile.lock +1 -1
- data/examples/website/specification/get-http.yml +20 -24
- data/examples/website/specification/get-https.yml +20 -24
- data/lib/webspicy.rb +3 -3
- data/lib/webspicy/formaldoc.fio +6 -6
- data/lib/webspicy/mocker/config.ru +5 -0
- data/lib/webspicy/specification.rb +5 -3
- data/lib/webspicy/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9109121647b9e9d4ed854078e12b81d5289b53d556e7c66ca671bd628435fa63
|
4
|
+
data.tar.gz: d6cfaf0f501d554066514a500de0a32a807eaacadaefe9722fb3d76b30b7d640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc0bbca8b1d924baaf23d87ab88b03e95e1111a936bd246200927770e89e512499cc7fb4871e46bf48929ad7f5025ce95ba891df5f01ba0232397e0446e8c701
|
7
|
+
data.tar.gz: 0c6cc0a0229167d84411da604af6549f6a4ac9a464a9ab208cf134a6b2b712a10b78e9ca353254830eeb20a092c31e1f1ad5d2ef1b048383d550dd1f17f56b44
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ to use our `:tester` docker image. Just mount your test suite as a volume
|
|
60
60
|
in `/home/app` and you are good to go:
|
61
61
|
|
62
62
|
```
|
63
|
-
docker run -v path/to/tests:/formalspec enspirit/webspicy
|
63
|
+
docker run -v path/to/tests:/formalspec enspirit/webspicy:tester
|
64
64
|
```
|
65
65
|
|
66
66
|
If your plan is to test a backend that runs on your own machine (vs.
|
@@ -69,7 +69,7 @@ you will need to add some networking option, as shown below. Please
|
|
69
69
|
refer to Docker documentation.
|
70
70
|
|
71
71
|
```
|
72
|
-
docker run -v path/to/tests:/formalspec --network=host enspirit/webspicy
|
72
|
+
docker run -v path/to/tests:/formalspec --network=host enspirit/webspicy:tester
|
73
73
|
```
|
74
74
|
|
75
75
|
## Contributing
|
@@ -1,34 +1,30 @@
|
|
1
1
|
---
|
2
|
-
name: |-
|
3
|
-
Your backend is broken website
|
4
|
-
|
5
2
|
url: |-
|
6
3
|
http://yourbackendisbroken.dev
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
GET
|
5
|
+
method: |-
|
6
|
+
GET
|
11
7
|
|
12
|
-
|
13
|
-
|
8
|
+
description: |-
|
9
|
+
Redirects to the https version
|
14
10
|
|
15
|
-
|
16
|
-
|
11
|
+
input_schema: |-
|
12
|
+
Any
|
17
13
|
|
18
|
-
|
19
|
-
|
14
|
+
output_schema: |-
|
15
|
+
Any
|
20
16
|
|
21
|
-
|
22
|
-
|
17
|
+
error_schema: |-
|
18
|
+
Any
|
23
19
|
|
24
|
-
|
20
|
+
examples:
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
- description: |-
|
23
|
+
it works
|
24
|
+
params:
|
25
|
+
id: 1
|
26
|
+
expected:
|
27
|
+
content_type: text/html
|
28
|
+
status: 3xx
|
29
|
+
headers:
|
30
|
+
Location: https://yourbackendisbroken.dev/?id=1
|
@@ -1,34 +1,30 @@
|
|
1
1
|
---
|
2
|
-
name: |-
|
3
|
-
Your backend is broken website
|
4
|
-
|
5
2
|
url: |-
|
6
3
|
https://yourbackendisbroken.dev
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
GET
|
5
|
+
method: |-
|
6
|
+
GET
|
11
7
|
|
12
|
-
|
13
|
-
|
8
|
+
description: |-
|
9
|
+
Returns the web page
|
14
10
|
|
15
|
-
|
16
|
-
|
11
|
+
input_schema: |-
|
12
|
+
Any
|
17
13
|
|
18
|
-
|
19
|
-
|
14
|
+
output_schema: |-
|
15
|
+
Any
|
20
16
|
|
21
|
-
|
22
|
-
|
17
|
+
error_schema: |-
|
18
|
+
Any
|
23
19
|
|
24
|
-
|
20
|
+
examples:
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
- description: |-
|
23
|
+
it works
|
24
|
+
params:
|
25
|
+
id: 1
|
26
|
+
expected:
|
27
|
+
content_type: text/html
|
28
|
+
status: 200
|
29
|
+
assert:
|
30
|
+
- notEmpty
|
data/lib/webspicy.rb
CHANGED
@@ -89,9 +89,9 @@ module Webspicy
|
|
89
89
|
module_function :test_case
|
90
90
|
|
91
91
|
def handle_finitio_error(ex, scope)
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
msg = "#{ex.message}:\n #{ex.root_cause.message}"
|
93
|
+
msg = Support::Colorize.colorize_error(msg, scope.config)
|
94
|
+
fatal(msg)
|
95
95
|
raise
|
96
96
|
end
|
97
97
|
module_function :handle_finitio_error
|
data/lib/webspicy/formaldoc.fio
CHANGED
@@ -18,14 +18,9 @@ FileUpload =
|
|
18
18
|
}
|
19
19
|
|
20
20
|
Specification = .Webspicy::Specification
|
21
|
-
<info> {
|
22
|
-
name: String
|
23
|
-
url: String
|
24
|
-
services: [Service]
|
25
|
-
}
|
26
21
|
<singleservice> {
|
27
22
|
name :? String
|
28
|
-
url :
|
23
|
+
url : String
|
29
24
|
method : Method
|
30
25
|
description : String
|
31
26
|
preconditions :? [String]|String
|
@@ -38,6 +33,11 @@ Specification = .Webspicy::Specification
|
|
38
33
|
examples :? [TestCase]
|
39
34
|
counterexamples :? [TestCase]
|
40
35
|
}
|
36
|
+
<info> {
|
37
|
+
name: String
|
38
|
+
url: String
|
39
|
+
services: [Service]
|
40
|
+
}
|
41
41
|
|
42
42
|
Service =
|
43
43
|
.Webspicy::Specification::Service <info> {
|
@@ -14,11 +14,13 @@ module Webspicy
|
|
14
14
|
|
15
15
|
def self.singleservice(raw)
|
16
16
|
converted = {
|
17
|
-
name: raw
|
17
|
+
name: raw[:name] || "Unamed specification",
|
18
18
|
url: raw[:url],
|
19
|
-
services: [
|
19
|
+
services: [
|
20
|
+
Webspicy.service(raw.reject{|k| k==:url or k==:name }, Webspicy.current_scope)
|
21
|
+
]
|
20
22
|
}
|
21
|
-
|
23
|
+
info(converted)
|
22
24
|
end
|
23
25
|
|
24
26
|
def located_at!(location)
|
data/lib/webspicy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webspicy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- lib/webspicy/configuration/single_yml_file.rb
|
246
246
|
- lib/webspicy/formaldoc.fio
|
247
247
|
- lib/webspicy/mocker.rb
|
248
|
+
- lib/webspicy/mocker/config.ru
|
248
249
|
- lib/webspicy/openapi.rb
|
249
250
|
- lib/webspicy/openapi/generator.rb
|
250
251
|
- lib/webspicy/specification.rb
|