Sha256: 9cd0bcd507a677c3feaa75723590aa157c402bdef4e3581d34022296f89567a4

Contents?: true

Size: 1.02 KB

Versions: 23

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'codeclimate-test-reporter'
require 'coveralls'
CodeClimate::TestReporter.start
Coveralls.wear!

describe MyDashboard do

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

  describe '.config' do

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

  end

  describe '.configure' do

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

    before do
      allow(MyDashboard).to receive(:config).and_return(:configuration)
    end

    context 'when block given' do

      it 'yields configuration' do
        expect(MyDashboard).to receive(:configure).and_yield(configuration)
        MyDashboard.configure {|config|}
      end

    end

    context 'when no block given' do

      it { expect(MyDashboard.configure).to be_nil }

    end

  end

  describe '.first_dashboard' do

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

    before do
      allow(Dir).to receive(:[]).and_return(dirs)
    end

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

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
my_dashboard-0.8.6 spec/lib/my_dashboard_spec.rb
my_dashboard-0.8.5 spec/lib/my_dashboard_spec.rb
my_dashboard-0.8.4 spec/lib/my_dashboard_spec.rb
my_dashboard-0.8.3 spec/lib/my_dashboard_spec.rb
my_dashboard-0.8.1 spec/lib/my_dashboard_spec.rb
my_dashboard-0.8.0 spec/lib/my_dashboard_spec.rb
my_dashboard-0.7.2 spec/lib/my_dashboard_spec.rb
my_dashboard-0.7.1 spec/lib/my_dashboard_spec.rb
my_dashboard-0.7.0 spec/lib/my_dashboard_spec.rb
my_dashboard-0.6.0 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.10 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.9 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.8 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.7 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.6 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.5 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.4 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.3 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.2 spec/lib/my_dashboard_spec.rb
my_dashboard-0.5.1 spec/lib/my_dashboard_spec.rb