github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/openapi-generator/templates/ruby-client/api_test.mustache (about) 1 require 'spec_helper' 2 require 'json' 3 4 # Unit tests for {{moduleName}}::{{classname}} 5 # Automatically generated by openapi-generator (https://openapi-generator.tech) 6 # Please update as you see appropriate 7 {{#operations}}describe '{{classname}}' do 8 before do 9 # run before each test 10 @api_instance = {{moduleName}}::{{classname}}.new 11 end 12 13 after do 14 # run after each test 15 end 16 17 describe 'test an instance of {{classname}}' do 18 it 'should create an instance of {{classname}}' do 19 expect(@api_instance).to be_instance_of({{moduleName}}::{{classname}}) 20 end 21 end 22 23 {{#operation}} 24 # unit tests for {{operationId}} 25 {{#summary}} 26 # {{summary}} 27 {{/summary}} 28 {{#notes}} 29 # {{notes}} 30 {{/notes}} 31 {{#allParams}}{{#required}} # @param {{paramName}} {{description}} 32 {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters 33 {{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}} 34 {{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] 35 describe '{{operationId}} test' do 36 it 'should work' do 37 # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers 38 end 39 end 40 41 {{/operation}} 42 end 43 {{/operations}}