Sha256: 6af44c3ac41afe8535a1d0b0e2e0789a6f255b494be700e1cdb1aa0d9c6b4692

Contents?: true

Size: 1.81 KB

Versions: 37

Compression:

Stored size: 1.81 KB

Contents

require 'spec_helper'
require 'flydata/command/setup'

module Flydata
  module Command
    describe Setup do
      subject { described_class.new }
      let(:sender) { double("sender") }
      let(:de) { {'type' => 'RedshiftMysqlDataEntry'} }
      let(:data_entries) { [ de ] }
      let(:flydata) { double('flydata') }
      let(:data_port) { double('data_port') }
      let(:dp) { double('dp') }
      let(:conf) { double('conf') }
      let(:sync_fm) { double('sync_fm') }
      let(:credentials) { double('credentials') }
      let(:login) { double('login') }

      before do
        allow(subject).to receive(:retrieve_data_entries).and_return(data_entries)
        allow(subject).to receive(:flydata).and_return(flydata)
        allow(flydata).to receive(:data_port).and_return(data_port)
        allow(flydata).to receive(:flydata_api_host).and_return('localhost')
        expect(flydata).to receive(:credentials).and_return(credentials)
        expect(credentials).to receive(:authenticated?).and_return(false)
        allow(data_port).to receive(:get).and_return(dp)
        expect(sender).to receive(:process_exist?).and_return(true)
        allow(sync_fm).to receive(:source_pos_path).and_return('/tmp')
        expect(conf).to receive(:copy_templates)
        expect(login).to receive(:run)
        expect(sender).to receive(:restart)
        allow(Flydata::SyncFileManager).to receive(:new).with(de).and_return(sync_fm)
      end
      it do
        expect(Flydata::Command::Conf).to receive(:new).and_return(conf)
        expect(Flydata::Command::Login).to receive(:new).and_return(login)
        expect(Flydata::Command::Sender).to receive(:new).and_return(sender).twice
        expect_any_instance_of(Flydata::Command::Setup).to receive(:system).with('flydata helper:restart')
        subject.initial_run
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
flydata-0.8.10.2 spec/flydata/command/setup_spec.rb
flydata-0.8.10.1 spec/flydata/command/setup_spec.rb
flydata-0.8.9.11 spec/flydata/command/setup_spec.rb
flydata-0.8.10 spec/flydata/command/setup_spec.rb
flydata-0.8.9 spec/flydata/command/setup_spec.rb
flydata-0.8.8 spec/flydata/command/setup_spec.rb
flydata-0.8.7 spec/flydata/command/setup_spec.rb
flydata-0.8.6 spec/flydata/command/setup_spec.rb
flydata-0.8.5 spec/flydata/command/setup_spec.rb
flydata-0.8.4 spec/flydata/command/setup_spec.rb
flydata-0.8.3 spec/flydata/command/setup_spec.rb
flydata-0.8.2 spec/flydata/command/setup_spec.rb
flydata-0.8.1 spec/flydata/command/setup_spec.rb
flydata-0.8.0 spec/flydata/command/setup_spec.rb
flydata-0.7.19 spec/flydata/command/setup_spec.rb
flydata-0.7.18 spec/flydata/command/setup_spec.rb
flydata-0.7.17 spec/flydata/command/setup_spec.rb
flydata-0.7.16 spec/flydata/command/setup_spec.rb
flydata-0.7.15 spec/flydata/command/setup_spec.rb
flydata-0.7.14 spec/flydata/command/setup_spec.rb