forked from loafle/openapi-generator-original
* fix obsolute configuration in generated .rubocop.yml * fix style of `expect` with block in generated ruby client's test code * update sample of ruby client
This commit is contained in:
parent
40cbbbfefd
commit
cc20eb8109
@ -150,7 +150,7 @@ describe {{moduleName}}::ApiClient do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'fails for invalid collection format' do
|
it 'fails for invalid collection format' do
|
||||||
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ AllCops:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Do not use braces for hash literals when they are the last argument of a
|
|
||||||
# method call.
|
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: context_dependent
|
|
||||||
|
|
||||||
# Align `when` with `case`.
|
# Align `when` with `case`.
|
||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||||||
Layout/EmptyLinesAroundModuleBody:
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/IndentFirstArgument:
|
Layout/FirstArgumentIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
@ -57,7 +51,7 @@ Style/HashSyntax:
|
|||||||
# extra level of indentation.
|
# extra level of indentation.
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
# Two spaces, no tabs (for indentation).
|
# Two spaces, no tabs (for indentation).
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
@ -123,7 +117,7 @@ Layout/Tab:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Blank lines should not have any spaces.
|
# Blank lines should not have any spaces.
|
||||||
Layout/TrailingBlankLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# No trailing whitespace.
|
# No trailing whitespace.
|
||||||
@ -131,7 +125,7 @@ Layout/TrailingWhitespace:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Use quotes for string literals when they are enough.
|
# Use quotes for string literals when they are enough.
|
||||||
Style/UnneededPercentQ:
|
Style/RedundantPercentQ:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Align `end` with the matching keyword or starting expression except for
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
@ -14,12 +14,6 @@ AllCops:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Do not use braces for hash literals when they are the last argument of a
|
|
||||||
# method call.
|
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: context_dependent
|
|
||||||
|
|
||||||
# Align `when` with `case`.
|
# Align `when` with `case`.
|
||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||||||
Layout/EmptyLinesAroundModuleBody:
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/IndentFirstArgument:
|
Layout/FirstArgumentIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
@ -57,7 +51,7 @@ Style/HashSyntax:
|
|||||||
# extra level of indentation.
|
# extra level of indentation.
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
# Two spaces, no tabs (for indentation).
|
# Two spaces, no tabs (for indentation).
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
@ -123,7 +117,7 @@ Layout/Tab:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Blank lines should not have any spaces.
|
# Blank lines should not have any spaces.
|
||||||
Layout/TrailingBlankLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# No trailing whitespace.
|
# No trailing whitespace.
|
||||||
@ -131,7 +125,7 @@ Layout/TrailingWhitespace:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Use quotes for string literals when they are enough.
|
# Use quotes for string literals when they are enough.
|
||||||
Style/UnneededPercentQ:
|
Style/RedundantPercentQ:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Align `end` with the matching keyword or starting expression except for
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
@ -14,12 +14,6 @@ AllCops:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Do not use braces for hash literals when they are the last argument of a
|
|
||||||
# method call.
|
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: context_dependent
|
|
||||||
|
|
||||||
# Align `when` with `case`.
|
# Align `when` with `case`.
|
||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||||||
Layout/EmptyLinesAroundModuleBody:
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/IndentFirstArgument:
|
Layout/FirstArgumentIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
@ -57,7 +51,7 @@ Style/HashSyntax:
|
|||||||
# extra level of indentation.
|
# extra level of indentation.
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
# Two spaces, no tabs (for indentation).
|
# Two spaces, no tabs (for indentation).
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
@ -123,7 +117,7 @@ Layout/Tab:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Blank lines should not have any spaces.
|
# Blank lines should not have any spaces.
|
||||||
Layout/TrailingBlankLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# No trailing whitespace.
|
# No trailing whitespace.
|
||||||
@ -131,7 +125,7 @@ Layout/TrailingWhitespace:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Use quotes for string literals when they are enough.
|
# Use quotes for string literals when they are enough.
|
||||||
Style/UnneededPercentQ:
|
Style/RedundantPercentQ:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Align `end` with the matching keyword or starting expression except for
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
@ -156,7 +156,7 @@ describe Petstore::ApiClient do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'fails for invalid collection format' do
|
it 'fails for invalid collection format' do
|
||||||
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ AllCops:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Do not use braces for hash literals when they are the last argument of a
|
|
||||||
# method call.
|
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: context_dependent
|
|
||||||
|
|
||||||
# Align `when` with `case`.
|
# Align `when` with `case`.
|
||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||||||
Layout/EmptyLinesAroundModuleBody:
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/IndentFirstArgument:
|
Layout/FirstArgumentIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
@ -57,7 +51,7 @@ Style/HashSyntax:
|
|||||||
# extra level of indentation.
|
# extra level of indentation.
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
# Two spaces, no tabs (for indentation).
|
# Two spaces, no tabs (for indentation).
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
@ -123,7 +117,7 @@ Layout/Tab:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Blank lines should not have any spaces.
|
# Blank lines should not have any spaces.
|
||||||
Layout/TrailingBlankLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# No trailing whitespace.
|
# No trailing whitespace.
|
||||||
@ -131,7 +125,7 @@ Layout/TrailingWhitespace:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Use quotes for string literals when they are enough.
|
# Use quotes for string literals when they are enough.
|
||||||
Style/UnneededPercentQ:
|
Style/RedundantPercentQ:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Align `end` with the matching keyword or starting expression except for
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
@ -118,7 +118,7 @@ describe Petstore::ApiClient do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'fails for invalid collection format' do
|
it 'fails for invalid collection format' do
|
||||||
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ AllCops:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Do not use braces for hash literals when they are the last argument of a
|
|
||||||
# method call.
|
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: context_dependent
|
|
||||||
|
|
||||||
# Align `when` with `case`.
|
# Align `when` with `case`.
|
||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||||||
Layout/EmptyLinesAroundModuleBody:
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/IndentFirstArgument:
|
Layout/FirstArgumentIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
@ -57,7 +51,7 @@ Style/HashSyntax:
|
|||||||
# extra level of indentation.
|
# extra level of indentation.
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
# Two spaces, no tabs (for indentation).
|
# Two spaces, no tabs (for indentation).
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
@ -123,7 +117,7 @@ Layout/Tab:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Blank lines should not have any spaces.
|
# Blank lines should not have any spaces.
|
||||||
Layout/TrailingBlankLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# No trailing whitespace.
|
# No trailing whitespace.
|
||||||
@ -131,7 +125,7 @@ Layout/TrailingWhitespace:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Use quotes for string literals when they are enough.
|
# Use quotes for string literals when they are enough.
|
||||||
Style/UnneededPercentQ:
|
Style/RedundantPercentQ:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Align `end` with the matching keyword or starting expression except for
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
@ -156,7 +156,7 @@ describe Petstore::ApiClient do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'fails for invalid collection format' do
|
it 'fails for invalid collection format' do
|
||||||
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user