Sha256: 17b79b3d32afcbccdff51224b519885750f4474c38873d649f6c2f0b52a02ae8

Contents?: true

Size: 973 Bytes

Versions: 6

Compression:

Stored size: 973 Bytes

Contents

require "spec_helper"

describe SectionsRails::Config do

  it 'is provided as a Singleton instance' do
    expect(SectionsRails.config).to_not be_nil
  end

  describe 'initialize' do

    describe 'options' do
      it 'uses reasonable default values' do
        config = SectionsRails::Config.new
        expect(config.path).to eql 'app/sections'
        expect(config.js_extensions).to include 'js'
        expect(config.js_extensions).to include 'js.coffee'
        expect(config.js_extensions).to include 'coffee'
      end

      it 'allows to provide custom configuration values' do
        config = SectionsRails::Config.new path: 'custom path'
        expect(config.path).to eql 'custom path'
      end

      it 'raises an ArgumentError if an unknown configuration option is provided' do
        expect { config = SectionsRails::Config.new zonk: 'foo'}.to raise_error ArgumentError, "Invalid option 'zonk' for SectionsRails::Config"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sections_rails-0.11.0 spec/sections_rails/config_spec.rb
sections_rails-0.10.0 spec/sections_rails/config_spec.rb
sections_rails-0.9.0 spec/sections_rails/config_spec.rb
sections_rails-0.8.1 spec/sections_rails/config_spec.rb
sections_rails-0.8.0 spec/sections_rails/config_spec.rb
sections_rails-0.7.2 spec/sections_rails/config_spec.rb