Sha256: 1b60147ae49ff923c4c4e016c8781035854901a6a0d762f8cbb61d61696d8670

Contents?: true

Size: 853 Bytes

Versions: 3

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'support/examples/generator'

describe SwaggerDocsGenerator::Generator, type: :gem,
                                          name: :generator, broken: true do
  before(:context) do
    @swag = SwaggerDocsGenerator::Generator.new
    @swagger_file = @swag.swagger_file
  end

  context 'File exist' do
    before(:context) do
      @swag.generate_swagger_file
    end

    describe '#generate_swagger_file' do
      let(:method) { @swag.generate_swagger_file }
      it_behaves_like 'method', nil
    end

    it { expect(File.exist?(@swagger_file)).to eql(true) }
    it { expect(@swagger_file).to match_json_schema(:swagger) }

    after(:context) { File.delete(@swagger_file) }
  end

  context "File doesn't exist" do
    it { expect(File.exist?(@swagger_file)).to eql(false) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
swagger_docs_generator-0.2.0.pre.11 spec/swagger_docs_generator/generator_spec.rb
swagger_docs_generator-0.2.0.pre.10 spec/swagger_docs_generator/generator_spec.rb
swagger_docs_generator-0.2.0.pre.9 spec/swagger_docs_generator/generator_spec.rb