Sha256: ee89d94f1ba407a632ccefb2b3688c3bd0f92edb7b1f1b7b9e202ad5a062ea7b

Contents?: true

Size: 900 Bytes

Versions: 11

Compression:

Stored size: 900 Bytes

Contents

require 'spec_helper'

describe Dashing do

  it { expect(Dashing).to respond_to :configuration }

  describe '.config' do

    it { expect(Dashing.config).to be_a(Dashing::Configuration) }

  end

  describe '.configure' do

    let(:configuration) { Dashing::Configuration.new }

    before do
      Dashing.stub(:config).and_return(:configuration)
    end

    context 'when block given' do

      it 'yields configuration' do
        Dashing.should_receive(:configure).and_yield(configuration)
        Dashing.configure {|config|}
      end

    end

    context 'when no block given' do

      it 'does nothing' do
        Dashing.configure.should be_nil
      end

    end

  end

  describe '.first_dashboard' do

    let(:dir)   { 'foo' }
    let(:dirs)  { [dir] }

    before do
      Dir.stub(:[]).and_return(dirs)
    end

    it { expect(Dashing.first_dashboard).to eq(dir) }

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dashing-rails-2.4.1 spec/lib/dashing_spec.rb
dashing-rails-2.4.0 spec/lib/dashing_spec.rb
dashing-rails-2.3.2 spec/lib/dashing_spec.rb
dashing-rails-2.3.1 spec/lib/dashing_spec.rb
dashing-rails-2.3.0 spec/lib/dashing_spec.rb
dashing-rails-2.2.0 spec/lib/dashing_spec.rb
dashing-rails-2.1.1 spec/lib/dashing_spec.rb
dashing-rails-2.1.0 spec/lib/dashing_spec.rb
dashing-rails-2.0.2 spec/lib/dashing_spec.rb
dashing-rails-2.0.1 spec/lib/dashing_spec.rb
dashing-rails-2.0.0 spec/lib/dashing_spec.rb