Sha256: 4f039cb5d896461226f1df7a3826c5d1323dd381ebbf4de808ef8a7be01c234d

Contents?: true

Size: 1.21 KB

Versions: 20

Compression:

Stored size: 1.21 KB

Contents

require "spec_helper"

describe  Invoker::CLI::TailWatcher do
  let(:tail_watcher) { Invoker::CLI::TailWatcher.new }

  describe "Adding processes to watch list" do
    it "should allow add" do
      tail_watcher.add(["rails"], "socket")
      expect(tail_watcher.tail_watchers).to_not be_empty
      expect(tail_watcher["rails"]).to eql ["socket"]
    end
  end

  describe "removing processes from watch list" do
    context "when process has only one watcher" do
      before do
        tail_watcher.add(["rails"], "socket")
      end
      it "should remove and purge process watch list" do
        expect(tail_watcher.tail_watchers).to_not be_empty
        tail_watcher.remove("rails", "socket")
        expect(tail_watcher.tail_watchers).to be_empty
      end
    end
    context "when process multiple watchers" do
      before do
        tail_watcher.add(["rails"], "socket")
        tail_watcher.add(["rails"], "socket2")
      end

      it "should remove only related socket" do
        expect(tail_watcher.tail_watchers).to_not be_empty
        tail_watcher.remove("rails", "socket")
        expect(tail_watcher.tail_watchers).to_not be_empty
        expect(tail_watcher["rails"]).to eql ["socket2"]
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 spec/invoker/cli/tail_watcher_spec.rb
itrg-invoker-1.6.0 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.8 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.7 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.6 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.5 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.4 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.3 spec/invoker/cli/tail_watcher_spec.rb
meepo-1.5.2 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.5.1 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.4.1 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.4.0 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.3.2 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.3.1 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.3.0 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.2.0 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.2.0.pre2 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.2.0.pre1 spec/invoker/cli/tail_watcher_spec.rb
invoker-1.2.0.pre spec/invoker/cli/tail_watcher_spec.rb
invoker-1.1.0 spec/invoker/cli/tail_watcher_spec.rb