Sha256: 0e47be3393a03b8e0c5df13cabb827f87477ab26fae98d75387fc1751e9eaed9

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Warden::Config do

  before(:each) do
    @config = Warden::Config.new
  end

  it "should behave like a hash" do
    @config[:foo] = :bar
    @config[:foo].should == :bar
  end

  it "should provide hash accessors" do
    @config.failure_app = :foo
    @config[:failure_app].should == :foo
    @config[:failure_app] = :bar
    @config.failure_app.should == :bar
  end

  it "should allow to read and set default strategies" do
    @config.default_strategies :foo, :bar
    @config.default_strategies.should == [:foo, :bar]
  end

  it "should allow to silence missing strategies" do
    @config.silence_missing_strategies!
    @config.silence_missing_strategies?.should be_true
  end

  it "should set the default_scope" do
    @config.default_scope.should == :default
    @config.default_scope = :foo
    @config.default_scope.should == :foo
  end

  it "should merge given options on initialization" do
    Warden::Config.new(:foo => :bar)[:foo].should == :bar
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
warden-0.9.7 spec/warden/config_spec.rb
warden-0.9.6 spec/warden/config_spec.rb
warden-0.9.5 spec/warden/config_spec.rb