Sha256: 22a400f0736bcde58214aab765e4d3554bd458343e64f1e5d77526f7c0531091

Contents?: true

Size: 939 Bytes

Versions: 12

Compression:

Stored size: 939 Bytes

Contents

require 'helper'

class TestDeprecations < Test::Unit::TestCase
  context "with Gelf object" do
    setup do
      @verbose, $VERBOSE = $VERBOSE, nil
      @g = Gelf.new('host', 12345)
    end

    teardown do
      $VERBOSE = @verbose
    end

    should "deprecate Gelf.new" do
      assert_equal Gelf, @g.class
      assert_equal 'host', @g.notifier.host
      assert_equal 12345, @g.notifier.port
      assert_equal Hash, @g.message.class
    end

    should "deprecate Gelf#send" do
      @g.notifier.expects(:notify).with(@g.message)
      @g.send
    end

    [:short_message, :full_message, :level, :host, :line, :file].each do |a|
      should "deprecate Gelf##{a} and Gelf##{a}=" do
        @g.__send__("#{a}=", 'value')
        assert_equal 'value', @g.__send__(a)
      end
    end

    should "set add additional params" do
      @g.add_additional(:key, 'value')
      assert_equal 'value', @g.message[:key]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gelf-1.1.3 test/test_deprecations.rb
gelf-1.1.1 test/test_deprecations.rb
gelf-1.1.0 test/test_deprecations.rb
gelf-1.1.0.rc1 test/test_deprecations.rb
gelf-1.1.0.gamma1 test/test_deprecations.rb
gelf-1.1.0.beta6 test/test_deprecations.rb
gelf-1.1.0.beta4 test/test_deprecations.rb
gelf-1.0.2 test/test_deprecations.rb
gelf-1.1.0.beta3 test/test_deprecations.rb
gelf-1.1.0.beta2 test/test_deprecations.rb
gelf-1.1.0.beta1 test/test_deprecations.rb
gelf-1.0.0 test/test_deprecations.rb