Sha256: c19c90696d46082787cf90e913fde05f877455d797b91533ebbb392dfcc2fd78

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe VersionCake::Configuration do
  subject(:config) { described_class.new }

  context '#missing_version' do
    before { config.missing_version = 5 }

    it { expect(config.missing_version).to eq 5 }
    it { expect(config.default_version).to eq 5 }
    it { expect(config.missing_version_use_unversioned_template).to eq false }

    context 'when set to use the base template' do
      before { config.missing_version = :unversioned_template }

      it { expect(config.missing_version).to eq :unversioned_template }
      it { expect(config.default_version).to be_nil }
      it { expect(config.missing_version_use_unversioned_template).to eq true }
    end
  end

  context 'by default' do
    it 'has all extraction strategies' do
      expect(config.extraction_strategies.map(&:class)).to match_array(
        VersionCake::ExtractionStrategy.list(
          :http_accept_parameter, :http_header, :request_parameter, :path_parameter, :query_parameter
        ).map(&:class)
      )
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
versioncake-4.1.1 spec/unit/configuration_spec.rb
versioncake-4.1.0 spec/unit/configuration_spec.rb
versioncake-4.0.2 spec/unit/configuration_spec.rb
versioncake-4.0.1 spec/unit/configuration_spec.rb
versioncake-4.0.0 spec/unit/configuration_spec.rb
versioncake-3.4.0 spec/unit/configuration_spec.rb