Sha256: bc391d2862a365eaaaf7f0dc2e1c94924d1ca14bc63e54351139f91be22ee159

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/test_helper")

class TestStacks < Minitest::Test

  def test_get_stack
    with_app do |app_data|
      response = heroku.get_stack(app_data['name'])

      assert_equal(200, response.status)
    end
  end

  def test_get_stack_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.get_stack(random_name)
    end
  end

  def test_put_stack
    with_app do |app_data|
      response = heroku.put_stack(app_data['name'], 'bamboo-ree-1.8.7')

      assert_equal(200, response.status)
    end
  end

  def test_put_stack_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.put_stack(random_name, 'bamboo-ree-1.8.7')
    end
  end

  def test_put_stack_stack_not_found
    with_app do |app_data|
      assert_raises(Heroku::API::Errors::NotFound) do
        heroku.put_stack(app_data['name'], random_name)
      end
    end
  end

  def test_put_stack_cedar
    with_app do |app_data|
      assert_raises(Heroku::API::Errors::RequestFailed) do
        heroku.put_stack(app_data['name'], 'cedar')
      end
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
heroku-api-0.4.3 test/test_stacks.rb
heroku-api-0.4.2 test/test_stacks.rb
heroku-api-0.4.1 test/test_stacks.rb
heroku-api-0.4.0 test/test_stacks.rb
heroku-api-0.3.23 test/test_stacks.rb
heroku-api-0.3.22 test/test_stacks.rb
heroku-api-0.3.21 test/test_stacks.rb
heroku-api-0.3.20 test/test_stacks.rb
heroku-api-0.3.19 test/test_stacks.rb
heroku-api-0.3.18 test/test_stacks.rb
heroku-api-0.3.17 test/test_stacks.rb
heroku-api-0.3.16 test/test_stacks.rb
heroku-api-0.3.15 test/test_stacks.rb
heroku-api-0.3.14 test/test_stacks.rb
heroku-api-0.3.13 test/test_stacks.rb
heroku-api-0.3.12 test/test_stacks.rb