Sha256: 5f5244c845906d417bceb5f639020d7e3c14b312774d372a4751a2be0adc470b

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe CaptainHoog::PluginList do
  describe 'instance methods' do
    it 'provides #plugins method' do
      expect(described_class.new).to respond_to(:plugins)
    end

    it 'provides #has?' do
      expect(described_class.new).to respond_to(:has?)
    end

    describe '#plugins' do

      let(:plugin_dir_path) do
        File.join(File.dirname(__FILE__),
                  '..', '..',
                  'fixtures',
                  'plugins',
                  'test_plugins',
                  'passing')
      end

      let(:shared_plugin_dir) do
        File.join(File.dirname(__FILE__),
                  '..', '..',
                  'fixtures',
                  'plugins',
                  'shared',
                  'passing')
      end

      let(:config) do
        {
          'exclude' => %w(mat git log),
          'pre-commit' => %w(rspec shared),
          'plugins_dir' => [plugin_dir_path, shared_plugin_dir]
        }
      end

      subject do
        described_class.new(config: config)
      end

      it 'returns available plugins' do
        expect(subject.plugins).to eq %w(rspec shared)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
captain_hoog-2.0.0 spec/lib/captain_hoog/plugin_list_spec.rb
captain_hoog-1.1.1 spec/lib/captain_hoog/plugin_list_spec.rb
captain_hoog-1.1.0 spec/lib/captain_hoog/plugin_list_spec.rb
captain_hoog-1.0.2 spec/lib/captain_hoog/plugin_list_spec.rb
captain_hoog-1.0.1 spec/lib/captain_hoog/plugin_list_spec.rb