Sha256: 667202b4d183dd6d36b3a45f5f4330bf0345e2c3fbfae9a81938003a4857a4c8

Contents?: true

Size: 922 Bytes

Versions: 6

Compression:

Stored size: 922 Bytes

Contents

require 'spec_helper'

RSpec.describe OmniHooks do
  describe '.strategies' do
    it 'increases when a new strategy is made' do
      expect {
        class ExampleStrategy
          include OmniHooks::Strategy
        end
      }.to change(OmniHooks.strategies, :size).by(1)
      expect(OmniHooks.strategies.last).to eq(ExampleStrategy)
    end
  end

  context 'configuration' do
    describe '.defaults' do
      it 'is a hash of default configuration' do
        expect(OmniHooks::Configuration.defaults).to be_kind_of(Hash)
      end
    end

    it 'is callable from .configure' do
      OmniHooks.configure do |c|
        expect(c).to be_kind_of(OmniHooks::Configuration)
      end
    end
  end

  describe '.logger' do
    it 'calls through to the configured logger' do
      allow(OmniHooks).to receive(:config).and_return(double(:logger => 'foo'))
      expect(OmniHooks.logger).to eq('foo')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
omnihooks-0.1.0 spec/omnihooks_spec.rb
omnihooks-0.0.5 spec/omnihooks_spec.rb
omnihooks-0.0.4 spec/omnihooks_spec.rb
omnihooks-0.0.3 spec/omnihooks_spec.rb
omnihooks-0.0.2 spec/omnihooks_spec.rb
omnihooks-0.0.1 spec/omnihooks_spec.rb