Sha256: fdb432ba83be0a3894b92ba8aa496018af8dd2a97bfcd40537d0566c7cae8cc1

Contents?: true

Size: 1.11 KB

Versions: 28

Compression:

Stored size: 1.11 KB

Contents

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

class TestStacks < MiniTest::Unit::TestCase

  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

28 entries across 28 versions & 2 rubygems

Version Path
heroku-api-0.3.11 test/test_stacks.rb
heroku-api-0.3.10 test/test_stacks.rb
pogoapp-api-0.3.8 test/test_stacks.rb
heroku-api-0.3.9 test/test_stacks.rb
heroku-api-0.3.8 test/test_stacks.rb
heroku-api-0.3.7 test/test_stacks.rb
heroku-api-0.3.6 test/test_stacks.rb
heroku-api-0.3.5 test/test_stacks.rb
heroku-api-0.3.4 test/test_stacks.rb
heroku-api-0.3.3 test/test_stacks.rb
heroku-api-0.3.2 test/test_stacks.rb
heroku-api-0.3.1 test/test_stacks.rb
heroku-api-0.3.0 test/test_stacks.rb
heroku-api-0.2.13 test/test_stacks.rb
heroku-api-0.2.12 test/test_stacks.rb
heroku-api-0.2.11 test/test_stacks.rb
heroku-api-0.2.10 test/test_stacks.rb
heroku-api-0.2.9 test/test_stacks.rb
heroku-api-0.2.8 test/test_stacks.rb
heroku-api-0.2.7 test/test_stacks.rb