forked from loafle/openapi-generator-original
* [crystal][client] allow initialize Configuration with block * [crystal][client] update samples * [crystal][client] add test for configuration.cr * [crystal][client] fix .configure * [crystal][client] update samples * [crystal][client] add test for pestore.cr * [crystal][client] fix Configuration#configure
27 lines
528 B
Crystal
27 lines
528 B
Crystal
require "./spec_helper"
|
|
|
|
describe Petstore::Configuration do
|
|
describe "#initialize" do
|
|
context "with block" do
|
|
it "works" do
|
|
config = Petstore::Configuration.new do |config|
|
|
config.username = "xxx"
|
|
end
|
|
|
|
config.username.should eq "xxx"
|
|
end
|
|
end
|
|
end
|
|
|
|
describe "#configure" do
|
|
it "works" do
|
|
config = Petstore::Configuration.new
|
|
config.configure do |config|
|
|
config.username = "xxx"
|
|
end
|
|
|
|
config.username.should eq "xxx"
|
|
end
|
|
end
|
|
end
|