Sha256: 9d6d828d4ef5bb489cd0905adfa74c070787206c3961e57754359ad9c0a24d44

Contents?: true

Size: 792 Bytes

Versions: 2

Compression:

Stored size: 792 Bytes

Contents

# encoding: utf-8

RSpec.describe Loaf::Configuration do
  it "allows to set and read attributes" do
    config = Loaf::Configuration.new

    config.crumb_length = 4

    expect(config.crumb_length).to eq(4)
  end

  it "accepts attributes at initialization" do
    options = { crumb_length: 12 }
    config = Loaf::Configuration.new(options)

    expect(config.crumb_length).to eq(12)
  end

  it "exports configuration as hash" do
    config = Loaf::Configuration.new
    expect(config.to_hash).to eq({
      capitalize: false,
      crumb_length: 30,
      locales_path: '/'
    })
  end

  it "yields configuration" do
    conf = double(:conf)
    allow(Loaf).to receive(:configuration).and_return(conf)
    expect { |b|
      Loaf.configure(&b)
    }.to yield_with_args(conf)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loaf-0.6.1 spec/unit/configuration_spec.rb
loaf-0.6.0 spec/unit/configuration_spec.rb