Sha256: d13f1452925a0ed0aba1a83ec35180994f90f275ba931ded9b4168a7e23bf9ca

Contents?: true

Size: 983 Bytes

Versions: 10

Compression:

Stored size: 983 Bytes

Contents

require 'test_helper'

class AllowFailureAnvilTest < Test::Unit::TestCase

  def setup
    @buildpack_path = File.expand_path 'test/fixtures/buildpacks/heroku-buildpack-ruby'
  end

  def test_allowed_failure
    Hatchet::AnvilApp.new("no_lockfile", buildpack: @buildpack_path, allow_failure: true).deploy do |app, heroku, output|
      refute app.deployed?
      assert_match "Gemfile.lock required", output
    end
  end

  def test_failure_with_no_flag
    assert_raise(Anvil::Builder::BuildError) do
      Hatchet::AnvilApp.new("no_lockfile", buildpack: @buildpack_path).deploy
    end
  end

  def test_retries
    orig_retries = Hatchet::RETRIES
    Hatchet.const_set(:RETRIES, 2)
    assert_raise(Anvil::Builder::BuildError) do
      app = Hatchet::AnvilApp.new("no_lockfile", buildpack: @buildpack_path)
      app.expects(:push_without_retry!).twice.raises(Anvil::Builder::BuildError)
      app.deploy
    end
  ensure
    Hatchet.const_set(:RETRIES, orig_retries)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
heroku_hatchet-1.3.7 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.6 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.5 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.4 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.3 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.2 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.1 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.3.0 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.2.1 test/hatchet/allow_failure_anvil_test.rb
heroku_hatchet-1.2.0 test/hatchet/allow_failure_anvil_test.rb