Sha256: b5684ceeb140cb07707f647b7034fc0f1f625c06ce68f6289c04f684db1b7eaf

Contents?: true

Size: 1.55 KB

Versions: 5

Compression:

Stored size: 1.55 KB

Contents

require 'spec_helper'

describe EyProCli do
  describe "deploy" do
    before(:each) do
      @tempfile.write <<-EOF
---
'#{subject.core_url}': #{SecureRandom.hex(20)}'
      EOF
      @tempfile.rewind
      subject.class.core_file = @tempfile
    end

    let(:options) { {} }

    context "with a running environment" do
      before(:each) do
        account, environment, application = boot_environment(subject.core_client)

        options.merge!(
          :account     => account.name,
          :app         => application.name,
          :environment => environment.name,
        )
      end

      it "successfully deploys" do
        subject.options = options

        expect(capture(:stdout) { subject.deploy }).to match(/deploy successful/i)
      end

      context "--stream" do
        before(:each) { options.merge!(stream: true) }

        it "streams" do
          subject.options = options
          expect(capture(:stdout) { subject.deploy }).to match(/subscription failed/i) # proves that the flag works, even if the mock doesn't
        end
      end

      context "--no-update-check" do
        before(:each) { subject.options = options }

        it "has the updater message without the flag" do
          expect(capture(:stdout) { subject.deploy }).to match(/gem outdated, consider updating/i)
        end

        it "does not have the message with the flag" do
          options.merge!("no-update-check" => true)

          expect(capture(:stdout) { subject.deploy }).not_to match(/gem outdated, consider updating/i)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ey-pro-cli-0.0.8 spec/deploy_spec.rb
ey-pro-cli-0.0.7 spec/deploy_spec.rb
ey-pro-cli-0.0.6 spec/deploy_spec.rb
ey-pro-cli-0.0.5 spec/deploy_spec.rb
ey-pro-cli-0.0.4 spec/deploy_spec.rb