Sha256: ef101120d3dea37c3f5f8101fb3297816e50f33e88e63def53107e70223c8588

Contents?: true

Size: 989 Bytes

Versions: 5

Compression:

Stored size: 989 Bytes

Contents

require 'rails_helper'

describe Apidoco::VersionParser do
  let(:v1_directory) { double(basename: 'v1', directory?: true, children: []) }
  let(:v2_directory) { double(basename: 'v2', directory?: true, children: []) }
  let(:base_directory) { double(children: [v1_directory, v2_directory]) }
  let(:version_parser) { described_class.new }

  before { allow(version_parser).to receive(:base_path).and_return(base_directory) }

  describe '#documentations' do
    subject(:documentations) { version_parser.documentations }

    before do
      expect(Apidoco::VersionDocumentation).to receive(:new).with(v1_directory).and_call_original
      expect(Apidoco::VersionDocumentation).to receive(:new).with(v2_directory).and_call_original
    end

    it { is_expected.to include(an_instance_of(Apidoco::VersionDocumentation)) }
  end

  describe '#documentation' do
    subject(:documentation) { version_parser.documentation('v1') }

    it { expect(documentation.name).to eq('v1') }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
apidoco-1.6.4 spec/apidoco/version_parser_spec.rb
apidoco-1.6.3 spec/apidoco/version_parser_spec.rb
apidoco-1.6.2 spec/apidoco/version_parser_spec.rb
apidoco-1.6.1 spec/apidoco/version_parser_spec.rb
apidoco-1.6.0 spec/apidoco/version_parser_spec.rb