Add test case for nil return value

This commit is contained in:
xhh 2015-05-20 21:13:20 +08:00
parent 50a767ef03
commit 8bf84aabe5

View File

@ -75,7 +75,9 @@ describe "Pet" do
it "should create a pet" do it "should create a pet" do
pet = SwaggerClient::Pet.new('id' => 10002, 'name' => "RUBY UNIT TESTING") pet = SwaggerClient::Pet.new('id' => 10002, 'name' => "RUBY UNIT TESTING")
SwaggerClient::PetApi.add_pet(:body => pet) result = SwaggerClient::PetApi.add_pet(:body => pet)
# nothing is returned
result.should be_nil
pet = SwaggerClient::PetApi.get_pet_by_id(10002) pet = SwaggerClient::PetApi.get_pet_by_id(10002)
pet.id.should == 10002 pet.id.should == 10002