samples/client/petstore/ruby/spec/petstore_helper.rb
# create a random pet, return its id
create a random pet, return its id
create a random pet return its id
def prepare_pet(pet_api)
  pet_id = random_id
  category = Petstore::Category.new('id' => 20002, 'name' => 'category test')
  tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test')
  pet = Petstore::Pet.new('id' => pet_id, 'name' => "RUBY UNIT TESTING", 'photo_urls' => 'photo url',
                          'category' => category, 'tags' => [tag], 'status' => 'pending')
  pet_api.add_pet(pet)
  pet_id
end
def prepare_pet ( pet_api ) pet_id = random_id category = Petstore :: Category . new ( 'id' => 20002 , 'name' => 'category test' ) tag = Petstore :: Tag . new ( 'id' => 30002 , 'name' => 'tag test' ) pet = Petstore :: Pet . new ( 'id' => pet_id , 'name' => "RUBY UNIT TESTING" , 'photo_urls' => 'photo url' , 'category' => category , 'tags' => [ tag ] , 'status' => 'pending' ) pet_api . add_pet ( pet ) pet_id end
create a random pet, return its id
create a random pet return its id
pet_api
<not_specific>