Sha256: c8a81e8db3826089391ce5de56c92ed867a331b8995a3c465f5bb71558879ad3

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
require 'guard/compat/test/helper'

describe Guard::Pumadev do
  let(:options) { { } }
  let(:plugin) { Guard::Pumadev.new(options) }

  describe '#initialize' do
    it 'instanciates manager with option' do
      expect(Guard::Pumadev::Manager).to receive(:new)
      plugin
    end
  end

  describe "start" do
    it "doesn't restart pow by default" do
      expect(plugin.manager).to_not receive(:restart)
      plugin.start
    end

    context "with restart_on_start option" do
      let(:options) { { restart_on_start: true } }

      it "restarts pow" do
        expect(plugin.manager).to receive(:restart)
        plugin.start
      end
    end
  end

  describe "reload" do
    it "restarts pow by default" do
      expect(plugin.manager).to receive(:restart)
      plugin.reload
    end

    context "with restart_on_reload option set to false" do
      let(:options) { { restart_on_reload: false } }

      it "doesn't restart pow" do
        expect(plugin.manager).to_not receive(:restart)
        plugin.reload
      end
    end
  end

  describe "run_on_changes" do
    it "restarts pow" do
      expect(plugin.manager).to receive(:restart)
      plugin.run_on_changes(["xxx"])
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guard-pumadev-2.0.1 spec/lib/guard/pumadev_spec.rb
guard-pumadev-2.0.0 spec/lib/guard/pumadev_spec.rb