webspicy 0.21.3 → 0.21.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: adc3c1464cb9c8972496a11fedda7a0dfda39e34ba82c5ad60a71ccc574d712c
4
- data.tar.gz: 892220efe2eadc8e1b62ea7e97039814de451f8949b5a89030cca027b3b4c383
3
+ metadata.gz: ba04baed1cda2292312644692901a18bc5a24f04a27be985a27097417ed731a9
4
+ data.tar.gz: 67edeff75f3cc4064c197efbd65b2bc4533b7214033226e31092b19f21bdc355
5
5
  SHA512:
6
- metadata.gz: 74243ff6d5c32357fa04da777ec9eede39a703405c8297abc7246b9f023dd1a34ed38c6ca6564326265fc9b59c46ae227ea0698de19c3256ffca2dc50d3a0ff0
7
- data.tar.gz: 79ed95fa65038bfff561c1956f728de2cfa57f705bc6d7b73bf8ba541d53f30056fc99eb231c28a1a91a5c61e8ca9b2b0ad8eaf1c5d5b482f9178068c97472ad
6
+ metadata.gz: 560122db62b3024ad5ab6c76f171438e2c45ed4bc1b23fcc9af895e444a7c86ba655826f59d1719ed3020e6bc75d224a072717391ab0862a09f37cb96f89c61a
7
+ data.tar.gz: 1ffb6d303cfcec6cc4d19c3f03c94f54acd16e50246f73171d00ab878229bf6fe16b18e4c16f9f8c139ca0557134d1b2c66af53c0c4c5cc3ef68782bd32c4710
@@ -13,6 +13,7 @@ module Webspicy
13
13
  @invocation = tester.invocation
14
14
  @assertions = []
15
15
  @failures = []
16
+ @warnings = []
16
17
  @errors = []
17
18
  if @invocation
18
19
  check!
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 21
5
- TINY = 3
5
+ TINY = 4
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -13,13 +13,13 @@ module Webspicy
13
13
  end
14
14
  attr_reader :config, :generator
15
15
 
16
- def call
16
+ def call(info = {})
17
17
  {
18
18
  openapi: "3.0.2",
19
19
  info: {
20
20
  version: "1.0.0",
21
- title: "Hello API"
22
- },
21
+ title: "Webspicy Specification"
22
+ }.merge(info),
23
23
  paths: paths
24
24
  }
25
25
  end
@@ -6,23 +6,45 @@ module Webspicy
6
6
  module Web
7
7
  module Openapi
8
8
  describe Generator do
9
-
10
- let(:config) {
9
+ let(:config) do
11
10
  Configuration.new(restful_folder)
12
- }
11
+ end
13
12
 
14
- subject {
15
- ruby_objs = Generator.new(config).call
13
+ subject do
14
+ ruby_objs = Generator.new(config).call(info)
16
15
  JSON.parse(ruby_objs.to_json)
17
- }
16
+ end
18
17
 
19
- it 'works fine' do
18
+ let(:info) do
19
+ {}
20
+ end
21
+
22
+ def openapi_document
20
23
  document = Openapi3Parser.load(subject)
21
- #puts JSON.pretty_generate(subject)
22
24
  document.errors.each do |err|
23
25
  puts err.inspect
24
26
  end unless document.errors.empty?
25
- expect(document.errors).to be_empty
27
+ document
28
+ end
29
+
30
+ it 'works fine' do
31
+ expect(openapi_document.errors).to be_empty
32
+ expect(openapi_document.info.title).to eql('Webspicy Specification')
33
+ end
34
+
35
+ describe 'when passing specific info' do
36
+ let(:info) {
37
+ {
38
+ version: '1.1.1',
39
+ title: 'Webspicy API'
40
+ }
41
+ }
42
+
43
+ it 'takes it into account' do
44
+ expect(openapi_document.errors).to be_empty
45
+ expect(openapi_document.info.title).to eql('Webspicy API')
46
+ expect(openapi_document.info.version).to eql('1.1.1')
47
+ end
26
48
  end
27
49
 
28
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.3
4
+ version: 0.21.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -408,7 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
408
408
  - !ruby/object:Gem::Version
409
409
  version: '0'
410
410
  requirements: []
411
- rubygems_version: 3.3.7
411
+ rubygems_version: 3.3.26
412
412
  signing_key:
413
413
  specification_version: 4
414
414
  summary: Webspicy helps testing web services as software operation black boxes!