Sha256: 7ea0379b22cf8301775a4cf1adc47c911ac0ea4ce52fc448a976a648dd7b85a0

Contents?: true

Size: 1.25 KB

Versions: 37

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe "ey recipes download" do
  given "integration"
  use_git_repo('default')

  before(:each) do
    FileUtils.rm_rf('cookbooks')
  end

  after(:each) do
    # This test creates + destroys the cookbooks/ directory, thus
    # rendering the git repo unsuitable for reuse.
    EY.refresh_git_repo('default')
  end

  def command_to_run(opts)
    cmd = %w[recipes download]
    cmd << "--environment" << opts[:environment] if opts[:environment]
    cmd << "--account"     << opts[:account]     if opts[:account]
    cmd
  end

  def verify_ran(scenario)
    @out.should =~ /Recipes downloaded successfully for #{scenario[:environment]}/
    File.read('cookbooks/README').should == "Remove this file to clone an upstream git repository of cookbooks\n"
  end

  include_examples "it takes an environment name and an account name"

  it "fails when cookbooks/ already exists" do
    login_scenario "one app, one environment"
    Dir.mkdir("cookbooks")
    ey %w[recipes download], :expect_failure => true
    @err.should match(/cookbooks.*already exists/i)
  end
end

describe "ey recipes download with an ambiguous git repo" do
  given "integration"
  def command_to_run(_) %w[recipes download] end
  include_examples "it requires an unambiguous git repo"
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
engineyard-3.1.2 spec/ey/recipes/download_spec.rb
engineyard-3.1.1 spec/ey/recipes/download_spec.rb
engineyard-3.1.0 spec/ey/recipes/download_spec.rb
engineyard-3.0.1 spec/ey/recipes/download_spec.rb
engineyard-3.0.0 spec/ey/recipes/download_spec.rb
engineyard-2.3.3 spec/ey/recipes/download_spec.rb
engineyard-2.3.2 spec/ey/recipes/download_spec.rb
engineyard-2.3.1 spec/ey/recipes/download_spec.rb
engineyard-2.3.0 spec/ey/recipes/download_spec.rb
engineyard-2.2.1 spec/ey/recipes/download_spec.rb
engineyard-2.2.0 spec/ey/recipes/download_spec.rb
engineyard-2.2.0.rc1 spec/ey/recipes/download_spec.rb
engineyard-2.1.3 spec/ey/recipes/download_spec.rb
engineyard-2.1.2 spec/ey/recipes/download_spec.rb
engineyard-2.1.1 spec/ey/recipes/download_spec.rb
engineyard-2.1.0 spec/ey/recipes/download_spec.rb
engineyard-2.1.0.rc1 spec/ey/recipes/download_spec.rb
engineyard-2.0.13 spec/ey/recipes/download_spec.rb
engineyard-2.0.12 spec/ey/recipes/download_spec.rb
engineyard-2.0.11 spec/ey/recipes/download_spec.rb