Sha256: 200996a7d188bf3b5b8f86cfa052d1658c9b5429e1e46b53d7691a0609f25e1d

Contents?: true

Size: 1.78 KB

Versions: 19

Compression:

Stored size: 1.78 KB

Contents

require 'spec_helper'

describe "ey environments" do

  given "integration"

  context "with no apps" do
    before do
      api_scenario "empty"
    end

    it "suggests that you use environments --all" do
      ey %w[environments]
      @out.should =~ /Use ey environments --all to see all environments./
    end
  end

  context "with apps" do
    before(:all) do
      api_scenario "one app, many environments"
    end

    it "lists the environments your app is in" do
      ey %w[environments]
      @out.should include('rails232app (main)')
      @out.should =~ /giblets/
      @out.should =~ /bakon/
    end

    it "reports failure to find a git repo when not in one" do
      Dir.chdir(Dir.tmpdir) do
        ey %w[environments], :expect_failure => true
        @err.should =~ /fatal: No git remotes found in .*#{Regexp.escape(Dir.tmpdir)}/
        @out.should_not =~ /no application configured/
      end
    end

    it "lists all environments that have apps with -a" do
      ey %w[environments -a]
      @out.should include("bakon")
      @out.should include("giblets")
    end

    it "outputs simply with -s" do
      ey %w[environments -s], :debug => false
      @out.split(/\n/).sort.should == ["bakon", "giblets"]
    end

    it "outputs all environments (including ones with no apps) simply with -a and -s" do
      ey %w[environments -a -s], :debug => false
      @out.split(/\n/).sort.should == ["bakon", "beef", "giblets"]
    end
  end
end

describe "ey environments with an ambiguous git repo" do
  given "integration"
  include_examples "it has an ambiguous git repo"

  it "lists environments from all apps using the git repo" do
    ey %w[environments]
    @out.should =~ /git repo matches multiple/i
    @out.should include("giblets")
    @out.should include("keycollector_production")
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
engineyard-1.4.29 spec/ey/list_environments_spec.rb
engineyard-1.4.28 spec/ey/list_environments_spec.rb
engineyard-1.4.27 spec/ey/list_environments_spec.rb
engineyard-1.4.24 spec/ey/list_environments_spec.rb
engineyard-1.4.23 spec/ey/list_environments_spec.rb
engineyard-1.4.22 spec/ey/list_environments_spec.rb
engineyard-1.4.21 spec/ey/list_environments_spec.rb
engineyard-1.4.20 spec/ey/list_environments_spec.rb
engineyard-1.4.19 spec/ey/list_environments_spec.rb
engineyard-1.4.18 spec/ey/list_environments_spec.rb
engineyard-1.4.17 spec/ey/list_environments_spec.rb
engineyard-1.4.16 spec/ey/list_environments_spec.rb
engineyard-1.4.15 spec/ey/list_environments_spec.rb
engineyard-1.4.14 spec/ey/list_environments_spec.rb
engineyard-1.4.13 spec/ey/list_environments_spec.rb
engineyard-1.4.11 spec/ey/list_environments_spec.rb
engineyard-1.4.10 spec/ey/list_environments_spec.rb
engineyard-1.4.9 spec/ey/list_environments_spec.rb
engineyard-1.4.8 spec/ey/list_environments_spec.rb