forked from loafle/openapi-generator-original
25
samples/client/petstore/ruby/spec/configuration_spec.rb
Normal file
25
samples/client/petstore/ruby/spec/configuration_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Petstore::Configuration do
|
||||
let(:config) { Petstore::Configuration.instance }
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user