require 'spec_helper'
require 'dpl/provider/bluemix_cloudfoundry'

describe DPL::Provider::BluemixCF do
  subject :provider do
    described_class.new(DummyContext.new, region: 'eu-gb', username: 'Moonpie',
                        password: 'myexceptionallyaveragepassword',
                        organization: 'myotherorg',
                        space: 'inner',
                        manifest: 'worker-manifest.yml',
                        skip_ssl_validation: true)
  end

  describe "#check_auth" do
    example do
      expect(provider.context).to receive(:shell).with('wget \'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github\' -qO cf-linux-amd64.tgz && tar -zxvf cf-linux-amd64.tgz && rm cf-linux-amd64.tgz')
      expect(provider.context).to receive(:shell).with('./cf api api.eu-gb.bluemix.net --skip-ssl-validation')
      expect(provider.context).to receive(:shell).with('./cf login -u Moonpie -p myexceptionallyaveragepassword -o myotherorg -s inner')
      provider.check_auth
    end
  end

end

Add Bluemix deploy provider test coverage
Add Bluemix deploy provider test coverage

Add spec class to test Bluemix deploy provider

Signed-off-by: Adam King <a74e182e49abf6252c9b13e1b94c4c5a47f8da9a@us.ibm.com>
