Sha256: b2f681bbdecb825de6ab15d2ea80f22223e1a6bf5422ba59b0fc11e3c7d875fc

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true
require 'test_helper'

class ConfigurationTest < ASDeprecationTracker::TestCase
  def test_envs
    assert_equal ['test'], config.envs
  end

  def test_envs=
    config.envs = ['development']
    assert_equal ['development'], config.envs
  end

  def test_line_tolerance
    assert_equal 10, config.line_tolerance
  end

  def test_line_tolerance=
    config.line_tolerance = 42
    assert_equal 42, config.line_tolerance
  end

  def test_register_behavior?
    assert_equal true, config.register_behavior?
  end

  def test_running_with_disable_true
    with_env(AS_DEPRECATION_DISABLE: 'true') do
      assert_equal false, config.register_behavior?
    end
  end

  def test_register_behavior=
    config.register_behavior = false
    assert_equal false, config.register_behavior?
  end

  def test_whitelist_file
    assert_kind_of String, config.whitelist_file
    assert File.exist?(File.join(Rails.root, config.whitelist_file))
  end

  def test_whitelist_file=
    config.whitelist_file = 'another_file.yaml'
    assert_equal 'another_file.yaml', config.whitelist_file
  end

  private

  def config
    @config ||= ASDeprecationTracker::Configuration.new
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
as_deprecation_tracker-1.5.0 test/configuration_test.rb