Sha256: 5beac35a4171ddbb5f1b4790c55b7365f5d195d376b9d87666a474f64fc09ddf

Contents?: true

Size: 1.74 KB

Versions: 47

Compression:

Stored size: 1.74 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)
        expect(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)
        expect(data_port).to receive(:get).and_return(dp)
        expect(sender).to receive(:process_exist?).and_return(true)
        expect(sender).to receive(:stop)
        expect(sync_fm).to receive(:binlog_path).and_return('/tmp')
        expect(conf).to receive(:copy_templates)
        expect(login).to receive(:run)
        expect(sender).to receive(:restart)
      end
      it do
        expect(Flydata::Command::Conf).to receive(:new).and_return(conf)
        expect(Flydata::SyncFileManager).to receive(:new).with(de).and_return(sync_fm)
        expect(Flydata::Command::Login).to receive(:new).and_return(login)
        expect(Flydata::Command::Sender).to receive(:new).and_return(sender).twice

        subject.initial_run
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
flydata-0.6.3 spec/flydata/command/setup_spec.rb
flydata-0.6.2 spec/flydata/command/setup_spec.rb
flydata-0.6.1 spec/flydata/command/setup_spec.rb
flydata-0.6.0 spec/flydata/command/setup_spec.rb
flydata-0.5.21 spec/flydata/command/setup_spec.rb
flydata-0.5.20 spec/flydata/command/setup_spec.rb
flydata-0.5.17 spec/flydata/command/setup_spec.rb
flydata-0.5.16 spec/flydata/command/setup_spec.rb
flydata-0.5.15 spec/flydata/command/setup_spec.rb
flydata-0.5.14 spec/flydata/command/setup_spec.rb
flydata-0.5.13 spec/flydata/command/setup_spec.rb
flydata-0.5.12 spec/flydata/command/setup_spec.rb
flydata-0.5.11 spec/flydata/command/setup_spec.rb
flydata-0.5.10 spec/flydata/command/setup_spec.rb
flydata-0.5.9 spec/flydata/command/setup_spec.rb
flydata-0.5.8 spec/flydata/command/setup_spec.rb
flydata-0.5.7 spec/flydata/command/setup_spec.rb
flydata-0.5.6 spec/flydata/command/setup_spec.rb
flydata-0.5.5 spec/flydata/command/setup_spec.rb
flydata-0.5.4 spec/flydata/command/setup_spec.rb