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.2 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.3.travis.3002.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2993.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2992.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2987.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2979.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2976.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.1 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.2.travis.2966.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.1.travis.2957.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.1.travis.2956.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.1.travis.2947.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.0 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.1.travis.2932.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.8 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.9.travis.2894.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.8.travis.2891.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.7 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.8.travis.2863.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.9.7.travis.2857.6 spec/provider/catalyze_spec.rb