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.8.10.2 spec/flydata/command/start_spec.rb
flydata-0.8.10.1 spec/flydata/command/start_spec.rb
flydata-0.8.9.11 spec/flydata/command/start_spec.rb
flydata-0.8.10 spec/flydata/command/start_spec.rb
flydata-0.8.9 spec/flydata/command/start_spec.rb
flydata-0.8.8 spec/flydata/command/start_spec.rb
flydata-0.8.7 spec/flydata/command/start_spec.rb
flydata-0.8.6 spec/flydata/command/start_spec.rb
flydata-0.8.5 spec/flydata/command/start_spec.rb
flydata-0.8.4 spec/flydata/command/start_spec.rb
flydata-0.8.3 spec/flydata/command/start_spec.rb
flydata-0.8.2 spec/flydata/command/start_spec.rb
flydata-0.8.1 spec/flydata/command/start_spec.rb
flydata-0.8.0 spec/flydata/command/start_spec.rb
flydata-0.7.19 spec/flydata/command/start_spec.rb
flydata-0.7.18 spec/flydata/command/start_spec.rb
flydata-0.7.17 spec/flydata/command/start_spec.rb
flydata-0.7.16 spec/flydata/command/start_spec.rb
flydata-0.7.15 spec/flydata/command/start_spec.rb
flydata-0.7.14 spec/flydata/command/start_spec.rb