mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
e9ef143d8f
Removed the singleton design from the Configuration class. Added a `config` field to ApiClient to hold the settings the ApiClient uses.
26 lines
596 B
Ruby
26 lines
596 B
Ruby
require 'spec_helper'
|
|
|
|
describe Petstore::Configuration do
|
|
let(:config) { Petstore::Configuration.default }
|
|
|
|
before(:each) do
|
|
Petstore.configure do |c|
|
|
c.host = 'petstore.swagger.io'
|
|
c.base_path = 'v2'
|
|
end
|
|
end
|
|
|
|
describe '#base_url' do
|
|
it 'should have the default value' do
|
|
config.base_url.should == 'http://petstore.swagger.io/v2'
|
|
end
|
|
|
|
it 'should remove trailing slashes' do
|
|
[nil, '', '/', '//'].each do |base_path|
|
|
config.base_path = base_path
|
|
config.base_url.should == 'http://petstore.swagger.io'
|
|
end
|
|
end
|
|
end
|
|
end
|