File: testGDC.rb

package info (click to toggle)
ruby-log4r 1.1.10-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 648 kB
  • sloc: ruby: 2,744; xml: 96; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'test_helper'

class TestGDC < TestCase
  include Log4r

  def test_gdc_default
    assert(GDC.get() == "testGDC.rb", "Expected 'testGDC.rb' got '#{GDC.get()}'" )
  end

  def test_gdc_set
    assert_nothing_raised() { GDC.set("testGDCset") }
    assert(GDC.get() == "testGDCset", "Expected 'testGDCset' got '#{GDC.get()}'" )
  end
  
  def test_gdc_threaded
    assert_nothing_raised() { GDC.set("testGDCset") }
    t = Thread.new("test GDC thread") do |name|
       assert_raise(RuntimeError) { GDC.set("somethingelse") }
    end
    t.join
    assert(GDC.get() == "testGDCset", "Expected 'testGDCset' got '#{GDC.get()}'" )
  end

end