swagger_docs_generator 0.2.0.pre.11 → 0.2.0.pre.12
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/lib/swagger_docs_generator/configuration/configuration.rb +10 -7
- data/lib/swagger_docs_generator/configuration/configuration_info.rb +2 -5
- data/lib/swagger_docs_generator/metadata/definition.rb +20 -1
- data/lib/swagger_docs_generator/metadata/info.rb +1 -1
- data/lib/swagger_docs_generator/methods.rb +9 -0
- data/lib/swagger_docs_generator/parser/controller.rb +3 -4
- data/lib/swagger_docs_generator/parser/definition.rb +37 -0
- data/lib/swagger_docs_generator/parser/parser.rb +1 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/support/examples/configuration.rb +6 -4
- data/spec/support/examples/metadata.rb +16 -0
- data/spec/swagger_docs_generator/configuration/configuration_customize_spec.rb +61 -0
- data/spec/swagger_docs_generator/configuration/configuration_default_spec.rb +48 -0
- data/spec/swagger_docs_generator/configuration/configuration_info_spec.rb +19 -0
- data/spec/swagger_docs_generator/generator_spec.rb +2 -1
- data/spec/swagger_docs_generator/metadata/configuration_spec.rb +16 -0
- data/spec/swagger_docs_generator/metadata/controller_spec.rb +18 -0
- data/spec/swagger_docs_generator/metadata/info_spec.rb +15 -0
- metadata +24 -3
- data/spec/swagger_docs_generator/configuration_spec.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9009aea8fd6b52d2b41879fc5cf447cd1249a3c1
|
4
|
+
data.tar.gz: e2cc9ae0b640d99f00709ae593f2b40309c2a84d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b5ca89476be2063bfbd8adaa803ac202513c2eafebe8f66b4bfc1b2169c0780c523e252a184b2a66167f77bdba289b2ba3b744a3c1eef22a0d4437e82a29c04
|
7
|
+
data.tar.gz: 1ce5c6e6a13a1512ab5af25e08f0df314c125e16afdbc9c9f5d9fc5e8569cb8b741cc4316af015686865ea5054812ef272d982a84e586c6baec17d0fa027ebbc
|
@@ -17,18 +17,21 @@ module SwaggerDocsGenerator
|
|
17
17
|
#
|
18
18
|
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
19
19
|
class Configuration
|
20
|
-
|
21
|
-
|
22
|
-
:security, :tags, :external_docs, :base_controller, :cleanning
|
20
|
+
# Accessors with default value
|
21
|
+
attr_accessor :swagger, :cleanning, :base_controller, :base_path
|
23
22
|
|
24
|
-
|
25
|
-
|
23
|
+
# Accessors without default value
|
24
|
+
attr_accessor :schemes, :consumes, :produces, :host, :external_docs,
|
25
|
+
:security, :definitions
|
26
|
+
# :external_docs, :security_definitions, :security
|
27
|
+
# :paths, :tags, :host
|
26
28
|
|
27
29
|
# Initalize default value (and requried) for json swagger file
|
28
30
|
def initialize
|
29
|
-
@swagger =
|
31
|
+
@swagger = '2.0'
|
30
32
|
@base_controller = ''
|
31
|
-
@
|
33
|
+
@base_path = '/'
|
34
|
+
@cleanning = true
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
@@ -11,13 +11,10 @@ module SwaggerDocsGenerator
|
|
11
11
|
attr_accessor :title, :description, :terms_of_service, :contact, :license,
|
12
12
|
:version
|
13
13
|
|
14
|
-
TITLE = 'Title Example API'
|
15
|
-
VERSION = '1.0.0'
|
16
|
-
|
17
14
|
# Initialize required element
|
18
15
|
def initialize
|
19
|
-
@title =
|
20
|
-
@version =
|
16
|
+
@title = 'Title Example API'
|
17
|
+
@version = '1.0.0'
|
21
18
|
end
|
22
19
|
end
|
23
20
|
|
@@ -15,11 +15,15 @@ module SwaggerDocsGenerator
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def construct_swagger_file
|
18
|
-
{ definitions:
|
18
|
+
{ definitions: search_definition }
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
+
def search_definition
|
24
|
+
find_models.merge!(find_in_controller)
|
25
|
+
end
|
26
|
+
|
23
27
|
# :reek:NilCheck
|
24
28
|
def find_models
|
25
29
|
hash = {}
|
@@ -30,6 +34,21 @@ module SwaggerDocsGenerator
|
|
30
34
|
hash
|
31
35
|
end
|
32
36
|
|
37
|
+
def find_in_controller
|
38
|
+
hash = {}
|
39
|
+
controllers.each do |controller|
|
40
|
+
file = File.join(file_path, "#{controller.controller_name}.json")
|
41
|
+
hash.merge!(read_file(file)) if File.exist?(file)
|
42
|
+
end
|
43
|
+
hash
|
44
|
+
end
|
45
|
+
|
46
|
+
# :reek:UtilityFunction
|
47
|
+
def read_file(file)
|
48
|
+
json = JSON.parse(File.read(file))
|
49
|
+
json.key?('definitions') ? json['definitions'] : {}
|
50
|
+
end
|
51
|
+
|
33
52
|
def each_controller(controller)
|
34
53
|
@model = Model.new(controller)
|
35
54
|
contruct_hash
|
@@ -17,5 +17,14 @@ module SwaggerDocsGenerator
|
|
17
17
|
parse = ParserAction.new(controller, action, data)
|
18
18
|
parse.adding_path
|
19
19
|
end
|
20
|
+
|
21
|
+
def swagger_definition(controller, name, parameters)
|
22
|
+
parse = ParserDefinition.new(controller, name, parameters)
|
23
|
+
parse.adding_defintion
|
24
|
+
end
|
25
|
+
|
26
|
+
alias scontroller swagger_controller
|
27
|
+
alias sdoc swagger_doc
|
28
|
+
alias sdefinition swagger_definition
|
20
29
|
end
|
21
30
|
end
|
@@ -15,8 +15,7 @@ module SwaggerDocsGenerator
|
|
15
15
|
def adding_tag
|
16
16
|
json = JSON.parse(File.read(controller_file))
|
17
17
|
File.open(controller_file, 'w') do |file|
|
18
|
-
|
19
|
-
json['tags'].merge!(hash)
|
18
|
+
json['tags'].merge!(construct_tags)
|
20
19
|
file.puts(JSON.pretty_generate(json))
|
21
20
|
end
|
22
21
|
end
|
@@ -33,8 +32,8 @@ module SwaggerDocsGenerator
|
|
33
32
|
File.delete(controller_file) if File.exist?(controller_file)
|
34
33
|
end
|
35
34
|
|
36
|
-
def construct_tags
|
37
|
-
{ name: controller_name, description: description }
|
35
|
+
def construct_tags
|
36
|
+
{ name: controller_name, description: @description }
|
38
37
|
end
|
39
38
|
end
|
40
39
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Parse Controller classes
|
5
|
+
#
|
6
|
+
# Parse controller classes in Rails application. It's create temporary file
|
7
|
+
# and adding automaticaly tags element.
|
8
|
+
class ParserDefinition < Parser
|
9
|
+
def initialize(controller, name, parameters)
|
10
|
+
super(controller)
|
11
|
+
@name = name
|
12
|
+
@parameters = parameters
|
13
|
+
end
|
14
|
+
|
15
|
+
def adding_defintion
|
16
|
+
json = JSON.parse(File.read(controller_file))
|
17
|
+
File.open(controller_file, 'w') do |file|
|
18
|
+
if json.key?('definitions')
|
19
|
+
json['definitions'].merge!(construct_definition)
|
20
|
+
else
|
21
|
+
json['definitions'] = construct_definition
|
22
|
+
end
|
23
|
+
file.puts(JSON.pretty_generate(json))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def construct_definition
|
30
|
+
{ format_name => { type: 'object', properties: @parameters } }
|
31
|
+
end
|
32
|
+
|
33
|
+
def format_name
|
34
|
+
@name.tr(' ', '_').camelize
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,9 +2,19 @@
|
|
2
2
|
|
3
3
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
4
4
|
|
5
|
+
require 'rails'
|
5
6
|
require 'bundler/setup'
|
6
7
|
require 'swagger_docs_generator'
|
7
8
|
require 'json-schema-rspec'
|
9
|
+
require 'pry'
|
10
|
+
|
11
|
+
Dir['spec/supporrt/**/*.rb'].each do |f|
|
12
|
+
require File.expand_path(f)
|
13
|
+
end
|
14
|
+
|
15
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each do |f|
|
16
|
+
require_relative f
|
17
|
+
end
|
8
18
|
|
9
19
|
RSpec.configure do |config|
|
10
20
|
# Configure RSpec
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RSpec.shared_examples 'variable exist' do |
|
4
|
-
it
|
5
|
-
|
6
|
-
|
3
|
+
RSpec.shared_examples 'variable exist' do |default|
|
4
|
+
it { expect(variable).to eql(default) }
|
5
|
+
end
|
6
|
+
|
7
|
+
RSpec.shared_examples 'variable does not exist' do
|
8
|
+
it { expect(variable).to be nil }
|
7
9
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.shared_examples 'configuration metadata is' do |method|
|
4
|
+
key = method.to_s.camelize(:lower).to_sym
|
5
|
+
|
6
|
+
include_examples 'metadata type is hash', method
|
7
|
+
it { expect(metadata.send(method)).to include(key) }
|
8
|
+
end
|
9
|
+
|
10
|
+
RSpec.shared_examples 'metadata type is hash' do |method|
|
11
|
+
it { expect(metadata.send(method)).to be_kind_of Hash }
|
12
|
+
end
|
13
|
+
|
14
|
+
RSpec.shared_examples 'metadata type is array' do |method|
|
15
|
+
it { expect(metadata.send(method)).to be_kind_of Array }
|
16
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SwaggerDocsGenerator::Configuration, type: :gem,
|
6
|
+
broken: true,
|
7
|
+
name: :configuration do
|
8
|
+
before(:example) do
|
9
|
+
SwaggerDocsGenerator.configure do |config|
|
10
|
+
config.schemes = ['http']
|
11
|
+
config.consumes = 'application/vnd.github.v3.full+json'
|
12
|
+
config.produces = 'application/vnd.github+json'
|
13
|
+
config.host = 'http://example.com'
|
14
|
+
config.swagger = '2.2.4'
|
15
|
+
config.cleanning = false
|
16
|
+
config.base_controller = []
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'with customize value' do
|
21
|
+
context 'swagger' do
|
22
|
+
let(:variable) { SwaggerDocsGenerator.config.swagger }
|
23
|
+
it_behaves_like 'variable exist', '2.2.4'
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'cleanning' do
|
27
|
+
let(:variable) { SwaggerDocsGenerator.config.cleanning }
|
28
|
+
it_behaves_like 'variable exist', false
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'base_controller' do
|
32
|
+
let(:variable) { SwaggerDocsGenerator.config.base_controller }
|
33
|
+
it_behaves_like 'variable exist', []
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'base_path' do
|
37
|
+
let(:variable) { SwaggerDocsGenerator.config.base_path }
|
38
|
+
it_behaves_like 'variable exist', '/'
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'schemes' do
|
42
|
+
let(:variable) { SwaggerDocsGenerator.config.schemes }
|
43
|
+
it_behaves_like 'variable exist', ['http']
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'consumes' do
|
47
|
+
let(:variable) { SwaggerDocsGenerator.config.consumes }
|
48
|
+
it_behaves_like 'variable exist', 'application/vnd.github.v3.full+json'
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'produces' do
|
52
|
+
let(:variable) { SwaggerDocsGenerator.config.produces }
|
53
|
+
it_behaves_like 'variable exist', 'application/vnd.github+json'
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'host' do
|
57
|
+
let(:variable) { SwaggerDocsGenerator.config.host }
|
58
|
+
it_behaves_like 'variable exist', 'http://example.com'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SwaggerDocsGenerator::Configuration, type: :gem,
|
6
|
+
name: :configuration do
|
7
|
+
describe 'with value default' do
|
8
|
+
context 'swagger' do
|
9
|
+
let(:variable) { SwaggerDocsGenerator.config.swagger }
|
10
|
+
it_behaves_like 'variable exist', '2.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'cleanning' do
|
14
|
+
let(:variable) { SwaggerDocsGenerator.config.cleanning }
|
15
|
+
it_behaves_like 'variable exist', true
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'base_controller' do
|
19
|
+
let(:variable) { SwaggerDocsGenerator.config.base_controller }
|
20
|
+
it_behaves_like 'variable exist', ''
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'base_path' do
|
24
|
+
let(:variable) { SwaggerDocsGenerator.config.base_path }
|
25
|
+
it_behaves_like 'variable exist', '/'
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'schemes' do
|
29
|
+
let(:variable) { SwaggerDocsGenerator.config.schemes }
|
30
|
+
it_behaves_like 'variable does not exist'
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'consumes' do
|
34
|
+
let(:variable) { SwaggerDocsGenerator.config.consumes }
|
35
|
+
it_behaves_like 'variable does not exist'
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'produces' do
|
39
|
+
let(:variable) { SwaggerDocsGenerator.config.produces }
|
40
|
+
it_behaves_like 'variable does not exist'
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'host' do
|
44
|
+
let(:variable) { SwaggerDocsGenerator.config.host }
|
45
|
+
it_behaves_like 'variable does not exist'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'support/examples/configuration'
|
5
|
+
|
6
|
+
describe SwaggerDocsGenerator::ConfigurationInfo, type: :gem,
|
7
|
+
name: :configuration_info do
|
8
|
+
describe 'with valie default' do
|
9
|
+
context 'title' do
|
10
|
+
let(:variable) { SwaggerDocsGenerator.info.title }
|
11
|
+
it_behaves_like 'variable exist', 'Title Example API'
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'version' do
|
15
|
+
let(:variable) { SwaggerDocsGenerator.info.version }
|
16
|
+
it_behaves_like 'variable exist', '1.0.0'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -4,7 +4,8 @@ require 'spec_helper'
|
|
4
4
|
require 'support/examples/generator'
|
5
5
|
|
6
6
|
describe SwaggerDocsGenerator::Generator, type: :gem,
|
7
|
-
|
7
|
+
broken: true,
|
8
|
+
name: :generator do
|
8
9
|
before(:context) do
|
9
10
|
@swag = SwaggerDocsGenerator::Generator.new
|
10
11
|
@swagger_file = @swag.swagger_file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SwaggerDocsGenerator::MetadataConfiguration, type: :metadata,
|
6
|
+
name: :configuration do
|
7
|
+
let(:metadata) { SwaggerDocsGenerator::MetadataConfiguration.new }
|
8
|
+
|
9
|
+
include_examples 'configuration metadata is', :swagger
|
10
|
+
include_examples 'configuration metadata is', :base_path
|
11
|
+
include_examples 'configuration metadata is', :schemes
|
12
|
+
include_examples 'configuration metadata is', :host
|
13
|
+
include_examples 'configuration metadata is', :definitions
|
14
|
+
include_examples 'configuration metadata is', :external_docs
|
15
|
+
include_examples 'configuration metadata is', :security
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SwaggerDocsGenerator::MetadataController, type: :metadata,
|
6
|
+
broken: true,
|
7
|
+
name: :configuration do
|
8
|
+
let(:metadata) { SwaggerDocsGenerator::MetadataController.new }
|
9
|
+
|
10
|
+
before(:context) do
|
11
|
+
class ApplicationController < ::ApplicationController
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it { expect(metadata.send(:class_controller)).to be_kind_of Array }
|
16
|
+
it { expect(metadata.send(:array_controller)).to be_kind_of Array }
|
17
|
+
it { expect(metadata.send(:string_controller)).to be_kind_of String }
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SwaggerDocsGenerator::MetadataInfo, type: :metadata,
|
6
|
+
name: :info do
|
7
|
+
let(:metadata) { SwaggerDocsGenerator::MetadataInfo.new }
|
8
|
+
|
9
|
+
include_examples 'configuration metadata is', :title
|
10
|
+
include_examples 'configuration metadata is', :version
|
11
|
+
include_examples 'configuration metadata is', :description
|
12
|
+
include_examples 'configuration metadata is', :terms_of_service
|
13
|
+
include_examples 'configuration metadata is', :contact
|
14
|
+
include_examples 'configuration metadata is', :license
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger_docs_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.pre.
|
4
|
+
version: 0.2.0.pre.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -202,6 +202,20 @@ dependencies:
|
|
202
202
|
- - ">="
|
203
203
|
- !ruby/object:Gem::Version
|
204
204
|
version: 1.7.3
|
205
|
+
- !ruby/object:Gem::Dependency
|
206
|
+
name: activesupport
|
207
|
+
requirement: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - "~>"
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '4.2'
|
212
|
+
type: :development
|
213
|
+
prerelease: false
|
214
|
+
version_requirements: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - "~>"
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '4.2'
|
205
219
|
description: Generates swagger-ui json file for rails-api
|
206
220
|
email:
|
207
221
|
- jeremy@dazzl.tv
|
@@ -239,6 +253,7 @@ files:
|
|
239
253
|
- lib/swagger_docs_generator/parser/actions/summary.rb
|
240
254
|
- lib/swagger_docs_generator/parser/actions/tags.rb
|
241
255
|
- lib/swagger_docs_generator/parser/controller.rb
|
256
|
+
- lib/swagger_docs_generator/parser/definition.rb
|
242
257
|
- lib/swagger_docs_generator/parser/model.rb
|
243
258
|
- lib/swagger_docs_generator/parser/models/active_record.rb
|
244
259
|
- lib/swagger_docs_generator/parser/models/mongo.rb
|
@@ -248,10 +263,16 @@ files:
|
|
248
263
|
- spec/spec_helper.rb
|
249
264
|
- spec/support/examples/configuration.rb
|
250
265
|
- spec/support/examples/generator.rb
|
266
|
+
- spec/support/examples/metadata.rb
|
251
267
|
- spec/support/schemas/swagger.json
|
252
|
-
- spec/swagger_docs_generator/
|
268
|
+
- spec/swagger_docs_generator/configuration/configuration_customize_spec.rb
|
269
|
+
- spec/swagger_docs_generator/configuration/configuration_default_spec.rb
|
270
|
+
- spec/swagger_docs_generator/configuration/configuration_info_spec.rb
|
253
271
|
- spec/swagger_docs_generator/gem_spec.rb
|
254
272
|
- spec/swagger_docs_generator/generator_spec.rb
|
273
|
+
- spec/swagger_docs_generator/metadata/configuration_spec.rb
|
274
|
+
- spec/swagger_docs_generator/metadata/controller_spec.rb
|
275
|
+
- spec/swagger_docs_generator/metadata/info_spec.rb
|
255
276
|
homepage: https://github.com/Dev-Crea/swagger-docs-generator
|
256
277
|
licenses:
|
257
278
|
- MIT
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'support/examples/configuration'
|
5
|
-
|
6
|
-
describe SwaggerDocsGenerator::Configuration, type: :gem,
|
7
|
-
name: :configuration do
|
8
|
-
specify do
|
9
|
-
expect { |config| SwaggerDocsGenerator.configure(&config) }.to yield_control
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:conf) { SwaggerDocsGenerator.configure }
|
13
|
-
let(:variable) { conf.swagger }
|
14
|
-
it_behaves_like 'variable exist', 'swagger'
|
15
|
-
end
|
16
|
-
|
17
|
-
describe SwaggerDocsGenerator::ConfigurationInfo, type: :gem,
|
18
|
-
name: :configuration_info do
|
19
|
-
let(:conf) { SwaggerDocsGenerator.configure_info }
|
20
|
-
let(:variable) { conf.title }
|
21
|
-
it_behaves_like 'variable exist', 'title'
|
22
|
-
let(:variable) { conf.version }
|
23
|
-
it_behaves_like 'variable exist', 'version'
|
24
|
-
end
|