Sha256: e726a0fe96aba78bf1f95a8488c0a954981a4aeb6f93720e55d94e7aa3b68741

Contents?: true

Size: 1003 Bytes

Versions: 51

Compression:

Stored size: 1003 Bytes

Contents

require 'spec_helper'
require 'flydata/command/start'

module Flydata
  module Command
    describe Start do
      subject { described_class.new }
      let(:sender) { double("sender") }
      let(:helper) { double("helper") }
      let(:opts) { double("opts") }

      it "should start sender and helper when no option is passed" do
        expect(Flydata::Command::Sender).to receive(:new).and_return(sender)
        expect(sender).to receive(:start)
        expect(Flydata::Command::Helper).to receive(:new).and_return(helper)
        expect(helper).to receive(:stop)
        expect(subject).to receive(:system) # Use Kernal#system to launch the helper
        subject.run

      end

      it "should only start sender when no options are passed" do
        expect(Flydata::Command::Sender).to receive(:new).and_return(sender)
        expect(sender).to receive(:start)
        expect(opts).to receive(:skip_helper?).and_return(true)
        described_class.new(opts).run
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
flydata-0.6.8 spec/flydata/command/start_spec.rb
flydata-0.6.7 spec/flydata/command/start_spec.rb
flydata-0.6.6 spec/flydata/command/start_spec.rb
flydata-0.6.5 spec/flydata/command/start_spec.rb
flydata-0.6.4 spec/flydata/command/start_spec.rb
flydata-0.6.3 spec/flydata/command/start_spec.rb
flydata-0.6.2 spec/flydata/command/start_spec.rb
flydata-0.6.1 spec/flydata/command/start_spec.rb
flydata-0.6.0 spec/flydata/command/start_spec.rb
flydata-0.5.21 spec/flydata/command/start_spec.rb
flydata-0.5.20 spec/flydata/command/start_spec.rb