Sha256: 0374edb326e47effaef87e984166abff408cf41f682826d0a76680a31394330b

Contents?: true

Size: 1.38 KB

Versions: 121

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
require 'dpl/provider/cloud_foundry'

describe DPL::Provider::CloudFoundry do
  subject :provider do
    described_class.new(DummyContext.new, api: 'api.run.awesome.io', username: 'mallomar',
                        password: 'myreallyawesomepassword',
                        organization: 'myorg',
                        space: 'outer')
  end

  describe "#check_auth" do
    example do
      expect(provider.context).to receive(:shell).with('wget http://go-cli.s3-website-us-east-1.amazonaws.com/releases/latest/cf-cli_amd64.deb -qO temp.deb && sudo dpkg -i temp.deb')
      expect(provider.context).to receive(:shell).with('rm temp.deb')
      expect(provider.context).to receive(:shell).with('cf api api.run.awesome.io')
      expect(provider.context).to receive(:shell).with('cf login --u mallomar --p myreallyawesomepassword --o myorg --s outer')
      provider.check_auth
    end
  end

  describe "#check_app" do
    example do
      expect{provider.check_app}.to raise_error('Application must have a manifest.yml for unattended deployment')
    end
  end

  describe "#needs_key?" do
    example do
      expect(provider.needs_key?).to eq(false)
    end
  end

  describe "#push_app" do
    example do
      expect(provider.context).to receive(:shell).with('cf push')
      expect(provider.context).to receive(:shell).with('cf logout')
      provider.push_app

    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
dpl-1.7.12.travis.764.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.12.travis.763.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.12.travis.762.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.12.travis.748.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.12.travis.742.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.12.travis.734.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.11.travis.733.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.11 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10 spec/provider/cloudfoundry_spec.rb
dpl-1.7.11.travis.726.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.725.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.701.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.700.4 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.699.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.694.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.681.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.677.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.674.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.673.1 spec/provider/cloudfoundry_spec.rb
dpl-1.7.10.travis.668.1 spec/provider/cloudfoundry_spec.rb