Sha256: 70e1fea4bd24f2d74f959cc24e993104360cd8b0025703ae0012c70fb8827a3a

Contents?: true

Size: 864 Bytes

Versions: 3

Compression:

Stored size: 864 Bytes

Contents

gem 'minitest'

require 'minitest/autorun'
require 'bib/opsworks/newrelic'

class NewrelicTest < Minitest::Test

  def test_publish_deployment
    newrelic = Bib::Opsworks::Newrelic.new

    deploy_data = { 'deploying_user' => 'arn:aws:iam::123456:user/gemtest', 'scm' => { 'revision' => 'rev1' } }
    app_name = 'unittest'

    result = newrelic.prepare_publishing_data(app_name, deploy_data)
    assert_equal("deployment[app_name]=unittest&deployment[user]=gemtest&deployment[revision]=rev1", result)
  end

  def test_publish_deployment_nouser
    newrelic = Bib::Opsworks::Newrelic.new

    deploy_data = { 'scm' => { 'revision' => 'rev1' } }
    app_name = 'unittest'

    result = newrelic.prepare_publishing_data(app_name, deploy_data)
    assert_equal("deployment[app_name]=unittest&deployment[user]=opsworks&deployment[revision]=rev1", result)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
BibOpsworks-0.0.5 tests/newrelic_test.rb
BibOpsworks-0.0.4 tests/newrelic_test.rb
BibOpsworks-0.0.3 tests/newrelic_test.rb