Sha256: 08c1fb864fec4c0648cd23442a9a901840bee501f3a5c48624203e2704863baf

Contents?: true

Size: 1.66 KB

Versions: 10

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe KPM::Migrations, skip_me_if_nil: ENV['TOKEN'].nil? do
  context 'plugins' do
    it 'should be able to find migrations for a java plugin' do
      migrations = KPM::Migrations.new('analytics-plugin-3.0.2', nil, 'killbill/killbill-analytics-plugin', ENV['TOKEN']).migrations
      # No migration yet
      expect(migrations.size).to eq 0
    end

    it 'should be able to find migrations for a ruby plugin' do
      migrations = KPM::Migrations.new('master', nil, 'killbill/killbill-cybersource-plugin', ENV['TOKEN']).migrations
      # No migration yet
      expect(migrations.size).to eq 1
    end
  end

  context 'killbill' do
    it 'should be able to find migrations between two versions' do
      migrations = KPM::Migrations.new('killbill-0.16.3', 'killbill-0.16.4', 'killbill/killbill', ENV['TOKEN']).migrations

      expect(migrations.size).to eq 1
      expect(migrations.first[:name]).to eq 'V20160324060345__revisit_payment_methods_indexes_509.sql'
      expect(migrations.first[:sql]).to eq "drop index payment_methods_active_accnt on payment_methods;\n"

      expect(KPM::Migrations.new('master', 'master', 'killbill/killbill', ENV['TOKEN']).migrations.size).to eq 0
    end

    it 'should be able to find migrations for a given version' do
      migrations = KPM::Migrations.new('killbill-0.16.4', nil, 'killbill/killbill', ENV['TOKEN']).migrations

      expect(migrations.size).to eq 1
      expect(migrations.first[:name]).to eq 'V20160324060345__revisit_payment_methods_indexes_509.sql'
      expect(migrations.first[:sql]).to eq "drop index payment_methods_active_accnt on payment_methods;\n"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kpm-0.10.6 spec/kpm/remote/migrations_spec.rb
kpm-0.11.1 spec/kpm/remote/migrations_spec.rb
kpm-0.10.5 spec/kpm/remote/migrations_spec.rb
kpm-0.11.0 spec/kpm/remote/migrations_spec.rb
kpm-0.10.4 spec/kpm/remote/migrations_spec.rb
kpm-0.10.3 spec/kpm/remote/migrations_spec.rb
kpm-0.10.2 spec/kpm/remote/migrations_spec.rb
kpm-0.10.1 spec/kpm/remote/migrations_spec.rb
kpm-0.10.0 spec/kpm/remote/migrations_spec.rb
kpm-0.9.0 spec/kpm/remote/migrations_spec.rb