Sha256: a76d91b0afe044e0dfad2bcdd03f8f484b67a1cf9d2b2d6d27af05783e5e069d

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe Spectifly::Configuration do
  let(:configuration_args) {
    {
      'entity_path' => base_fixture_path
    }
  }
  describe '.initialize' do
    it 'succeeds if entity and destination paths provided' do
      expect { described_class.new(configuration_args) }.not_to raise_error
    end

    it 'fails if no entity path provided' do
      configuration_args.delete('entity_path')
      expect { described_class.new(configuration_args) }.to raise_error
    end
  end

  describe '#presenter_path' do
    it 'returns configured value if set' do
      configuration = described_class.new(
        configuration_args.merge('presenter_path' => 'goose')
      )
      configuration.presenter_path.should == 'goose'
    end

    it 'returns nil if no presenter path exists at entity path' do
      configuration = described_class.new(
        configuration_args.merge('entity_path' => spec_path)
      )
      configuration.presenter_path.should be_nil
    end

    it 'returns {entity_path}/presenters if exists' do
      configuration = described_class.new(
        configuration_args
      )
      configuration.presenter_path.should == base_presenter_path
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spectifly-0.0.10 spec/spectifly/configuration_spec.rb
spectifly-0.0.9 spec/spectifly/configuration_spec.rb
spectifly-0.0.8 spec/spectifly/configuration_spec.rb
spectifly-0.0.7 spec/spectifly/configuration_spec.rb
spectifly-0.0.6 spec/spectifly/configuration_spec.rb
spectifly-0.0.5 spec/spectifly/configuration_spec.rb
spectifly-0.0.4 spec/spectifly/configuration_spec.rb
spectifly-0.0.3 spec/spectifly/configuration_spec.rb
spectifly-0.0.2 spec/spectifly/configuration_spec.rb