Sha256: d9bd84f01d5a7e7658a24093aa628844d7ef98649b73497da65e1e438debe052

Contents?: true

Size: 1.67 KB

Versions: 291

Compression:

Stored size: 1.67 KB

Contents

require 'spec_helper'
require 'dpl/provider/catalyze'

describe DPL::Provider::Catalyze do
  subject :provider do
    described_class.new(DummyContext.new, :target => 'test-target', :path => 'test-path')
  end

  describe "#check_auth" do
    it 'should require a target' do
      provider.options.update(:target => nil)
      expect{ provider.check_auth }.to raise_error("Missing Catalyze target")
    end
  end

  describe "#push_app" do
    it 'should push the current branch to the target' do
      expect(provider.context).to receive(:shell).with("git push --force test-target HEAD:master")
      provider.push_app
    end
    it 'should add and commit local build files if skip_cleanup is true' do
      provider.options.update(:skip_cleanup => true)
      expect(provider.context).to receive(:shell).with("git checkout HEAD")
      expect(provider.context).to receive(:shell).with("git add test-path --all --force")
      expect(provider.context).to receive(:shell).with("git commit -m \"Local build\" --quiet")
      expect(provider.context).to receive(:shell).with("git push --force test-target HEAD:master")
      provider.push_app
    end
    it 'should use a path of "." if the path is not specified' do
      provider.options.update(:path => nil)
      provider.options.update(:skip_cleanup => true)
      expect(provider.context).to receive(:shell).with("git checkout HEAD")
      expect(provider.context).to receive(:shell).with("git add . --all --force")
      expect(provider.context).to receive(:shell).with("git commit -m \"Local build\" --quiet")
      expect(provider.context).to receive(:shell).with("git push --force test-target HEAD:master")
      provider.push_app
    end
  end
end

Version data entries

291 entries across 291 versions & 3 rubygems

Version Path
dpl-catalyze-1.10.17.travis.6637.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.16 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.16.travis.6625.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.16.travis.6619.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.16.travis.5961.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.15 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.15.travis.5877.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.14 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.13 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.13.travis.4159.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.13.travis.4141.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.13.travis.4040.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.13.travis.4033.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.12 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.12.travis.4032.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.12.travis.3794.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.12.travis.3506.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.11.travis.3504.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.11 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.11.travis.3499.5 spec/provider/catalyze_spec.rb