Sha256: 4fe9dbb5a16494874af8fa16d0488b4e0f8f4b1119bf3ccf473aa8d10b0d7fbd

Contents?: true

Size: 561 Bytes

Versions: 33

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

require 'timezone/deprecate'
require 'minitest/autorun'

class TestDeprecate < ::Minitest::Test
  # This test should not be parallelized because it tests the result
  # of a single class-level attribute.
  def test_callback
    values = []

    Timezone::Deprecate.callback = lambda do |klass, method, message|
      values = [klass, method, message]
    end

    Timezone::Deprecate.call(self, :test_message, 'foo')

    assert_equal [self, :test_message, 'foo'], values
  ensure
    Timezone::Deprecate.callback = nil
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
timezone-1.3.8 test/timezone/test_deprecate.rb
timezone-1.3.7 test/timezone/test_deprecate.rb
timezone-1.3.6 test/timezone/test_deprecate.rb
timezone-1.3.5 test/timezone/test_deprecate.rb
timezone-1.3.4 test/timezone/test_deprecate.rb
timezone-1.3.3 test/timezone/test_deprecate.rb
timezone-1.3.2 test/timezone/test_deprecate.rb
timezone-1.3.1 test/timezone/test_deprecate.rb
timezone-1.3.0 test/timezone/test_deprecate.rb
timezone-1.2.12 test/timezone/test_deprecate.rb
timezone-1.2.11 test/timezone/test_deprecate.rb
timezone-1.2.10 test/timezone/test_deprecate.rb
timezone-1.2.9 test/timezone/test_deprecate.rb