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.11.travis.3497.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.10 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.9 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.9.travis.3280.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.9.travis.3258.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.8 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.8.travis.3236.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.8.travis.3216.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.8.travis.3178.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3177.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3151.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3128.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3125.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3126.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.7.travis.3120.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.6.travis.3119.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.6 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.6.travis.3118.5 spec/provider/catalyze_spec.rb
dpl-catalyze-1.10.6.travis.3114.5 spec/provider/catalyze_spec.rb