Sha256: 2b2b9342f7dc32cbce74bbec9f2a13d42b0328c53f5514eb692e9a072a924fd4

Contents?: true

Size: 970 Bytes

Versions: 13

Compression:

Stored size: 970 Bytes

Contents

require 'spec_helper'
require_relative '../helper_shared_context'
require 'flydata/helper/action/reset'

module Flydata
  module Helper
    module Action
      describe Reset do
        include_context 'helper context'

        describe "#command" do
          subject { described_class.new(config).command(opts) }

          context 'without opts' do
            let(:opts) { {} }
            it { expect{subject}.to raise_error(/^Wrong tables parameter/) }
          end

          context 'with tables array' do
            let(:opts) { {config_hash: {tables: %w(table_a table_b)}} }
            it { is_expected.to eq("sync:reset -y --force --include-unregistered table_a table_b") }
          end

          context 'with tables string' do
            let(:opts) { {config_hash: {tables: "table_a table_b"}} }
            it { is_expected.to eq("sync:reset -y --force --include-unregistered table_a table_b") }
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
flydata-0.8.10.2 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.10.1 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.9.11 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.10 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.9 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.8 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.7 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.6 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.5 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.4 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.3 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.2 spec/flydata/helper/action/reset_spec.rb
flydata-0.8.1 spec/flydata/helper/action/reset_spec.rb