Sha256: 7230a4bb3da825b4914e8c815a0368452a0bbd36942333f2c351deeefa5a7cb3

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__),'/../../test_helper'))
class NewRelic::Control::ConfigurationTest < Test::Unit::TestCase
  require 'new_relic/control/configuration'
  include NewRelic::Control::Configuration
  def test_license_key_defaults_to_env_variable
    ENV['NEWRELIC_LICENSE_KEY'] = nil
    self.expects(:fetch).with('license_key', nil)
    license_key

    ENV['NEWRELIC_LICENSE_KEY'] = "a string"
    self.expects(:fetch).with('license_key', 'a string')
    license_key
  end
  
  def test_log_file_path_uses_default_if_not_set
    root = ::Rails::VERSION::MAJOR == 3 ? Rails.root : RAILS_ROOT
    assert_equal(File.join(root, 'log'),
                 NewRelic::Control.instance.log_file_path)
  end

  def test_log_file_path_uses_given_value
    NewRelic::Control.instance['log_file_path'] = '/lerg'
    assert_equal '/lerg', NewRelic::Control.instance.log_file_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
newrelic_rpm-3.1.1.beta2 test/new_relic/control/configuration_test.rb
newrelic_rpm-3.1.1.beta1 test/new_relic/control/configuration_test.rb