pantheios-ruby 0.22.2 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +26 -0
- data/NEWS.md +1 -0
- data/TODO.md +5 -2
- data/examples/coloured_console_log_service.rb +1 -1
- data/examples/multiple_modules.rb +36 -36
- data/examples/simple_logging.rb +1 -1
- data/examples/threshold_front_end.rb +1 -1
- data/lib/pantheios/api.rb +154 -153
- data/lib/pantheios/application_layer/stock_severity_levels.rb +108 -108
- data/lib/pantheios/application_layer.rb +5 -5
- data/lib/pantheios/core.rb +415 -414
- data/lib/pantheios/front_ends/threshold_front_end.rb +79 -79
- data/lib/pantheios/globals.rb +43 -43
- data/lib/pantheios/services/coloured_console_log_service.rb +94 -94
- data/lib/pantheios/services/common/console.rb +57 -57
- data/lib/pantheios/services/multiplexing_log_service.rb +149 -148
- data/lib/pantheios/services/null_log_service.rb +9 -9
- data/lib/pantheios/services/simple_console_log_service.rb +18 -18
- data/lib/pantheios/services/simple_file_log_service.rb +110 -111
- data/lib/pantheios/services/standard_log_service_adapter.rb +117 -117
- data/lib/pantheios/util/process_util.rb +24 -24
- data/lib/pantheios/util/reflection_util.rb +13 -13
- data/lib/pantheios/util/thread_util.rb +49 -49
- data/lib/pantheios/util/version_util.rb +33 -33
- data/lib/pantheios/version.rb +12 -12
- data/lib/pantheios.rb +11 -11
- data/test/performance/test_perf_simple_statements.rb +58 -58
- data/test/performance/test_perf_trace_variants.rb +43 -57
- data/test/scratch/log_rolling_by_period_daily.rb +3 -3
- data/test/scratch/log_rolling_by_size_and_depth.rb +3 -3
- data/test/scratch/log_using_blocks.rb +12 -12
- data/test/scratch/multiplexing_log_service.rb +32 -32
- data/test/unit/application_layer/tc_param_name_list.rb +13 -13
- data/test/unit/application_layer/tc_stock_severity_levels.rb +102 -102
- data/test/unit/core/tc_core_1.rb +24 -24
- data/test/unit/front_ends/tc_threshold_front_end.rb +65 -65
- data/test/unit/services/tc_multiplexing_log_service.rb +79 -79
- data/test/unit/services/tc_null_log_service.rb +42 -42
- data/test/unit/services/tc_simple_console_log_service.rb +70 -70
- data/test/unit/services/tc_simple_file_log_service.rb +146 -146
- data/test/unit/services/tc_standard_log_service_adapter.rb +94 -96
- data/test/unit/util/tc_process_util.rb +6 -6
- data/test/unit/util/tc_reflection_util.rb +20 -20
- data/test/unit/util/tc_thread_util.rb +46 -46
- data/test/unit/util/tc_version_util.rb +47 -47
- metadata +6 -6
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Purpose: Tests the log-rolling functionality of SimpleFileLogService
|
|
7
7
|
#
|
|
8
8
|
# Created: 4th February 2018
|
|
9
|
-
# Updated:
|
|
9
|
+
# Updated: 28th August 2026
|
|
10
10
|
#
|
|
11
11
|
# Author: Matthew Wilson
|
|
12
12
|
#
|
|
@@ -33,9 +33,9 @@ log(:notice) { 'program started' }
|
|
|
33
33
|
|
|
34
34
|
(0..1000).each do |n|
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
log :informational, "increment #{n}: '#{'*' * 10 * n}'"
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
sleep 1
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
at_exit { log :notice, 'program ending ...' }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Purpose: COMPLETE_ME
|
|
7
7
|
#
|
|
8
8
|
# Created: 22nd January 2018
|
|
9
|
-
# Updated:
|
|
9
|
+
# Updated: 28th August 2026
|
|
10
10
|
#
|
|
11
11
|
# Author: Matthew Wilson
|
|
12
12
|
#
|
|
@@ -32,33 +32,33 @@ log(:notice) { 'program started' }
|
|
|
32
32
|
|
|
33
33
|
def f param0, param1
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
trace
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
log :trace
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
trace param0, param1
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
log :trace, param0, param1
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
trace ParamNames[ :param0, :param1 ], param0, param1
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
log :trace, ParamNames[ :param0, :param1 ], param0, param1
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
trace { [ ParamNames[ :param0, :param1 ], param0, param1 ] }
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def g param0, param1
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
trace(param0, param1) { [ ParamNames[ :param0, :param1 ]] }
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
f param0, param1
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def h param0, param1, param2
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
trace(param0, param1, param2) { ParamNames[ :param0, :param1, :param2 ] }
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
g param0, param1
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Purpose: COMPLETE_ME
|
|
7
7
|
#
|
|
8
8
|
# Created: 7th February 2018
|
|
9
|
-
# Updated:
|
|
9
|
+
# Updated: 28th August 2026
|
|
10
10
|
#
|
|
11
11
|
# Author: Matthew Wilson
|
|
12
12
|
#
|
|
@@ -20,60 +20,60 @@ require 'pantheios'
|
|
|
20
20
|
require 'pantheios/application_layer/stock_severity_levels'
|
|
21
21
|
require 'pantheios/services'
|
|
22
22
|
|
|
23
|
-
$num_BLS_sls
|
|
24
|
-
$num_ELS_sls
|
|
23
|
+
$num_BLS_sls = 0
|
|
24
|
+
$num_ELS_sls = 0
|
|
25
25
|
|
|
26
26
|
class BenchmarkLogService
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
def severity_logged? severity
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
$num_BLS_sls += 1
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
(0..100).each { |n| n ** n }
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
:benchmark == severity.to_s.to_sym
|
|
35
|
+
end
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
def log sev, t, pref, msg
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
puts "BENCHMARK: #{pref}#{msg}\n"
|
|
40
|
+
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
class EventLogService
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
def severity_logged? severity
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
$num_ELS_sls += 1
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
case severity.to_s.to_sym
|
|
50
|
+
when :notice, :warning, :failure, :critical, :alert, :violation
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
true
|
|
53
|
+
when :warn, :error, :emergency
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
true
|
|
56
|
+
else
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
false
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
def log sev, t, pref, msg
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
puts "EVENTLOG: #{pref}#{msg}\n"
|
|
65
|
+
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
scls
|
|
68
|
+
scls = Pantheios::Services::SimpleConsoleLogService.new
|
|
69
69
|
|
|
70
70
|
def scls.severity_logged? severity; ![ :benchmark, :trace, :violation ].include? severity; end
|
|
71
71
|
|
|
72
|
-
services
|
|
72
|
+
services = [
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
BenchmarkLogService.new,
|
|
75
|
+
EventLogService.new,
|
|
76
|
+
scls,
|
|
77
77
|
]
|
|
78
78
|
|
|
79
79
|
lcm = :none
|
|
@@ -86,7 +86,7 @@ Pantheios::Core.set_service Pantheios::Services::MultiplexingLogService.new(serv
|
|
|
86
86
|
|
|
87
87
|
include Pantheios
|
|
88
88
|
|
|
89
|
-
t_b
|
|
89
|
+
t_b = Time.now
|
|
90
90
|
|
|
91
91
|
log :benchmark, 'statement at benchmark'
|
|
92
92
|
(0..100000).each { log :trace, 'statement at trace' }
|
|
@@ -103,7 +103,7 @@ log :critical, 'statement at critical'
|
|
|
103
103
|
log :alert, 'statement at alert'
|
|
104
104
|
log :violation, 'statement at violation'
|
|
105
105
|
|
|
106
|
-
t_a
|
|
106
|
+
t_a = Time.now
|
|
107
107
|
|
|
108
108
|
$stderr.puts "mode= :#{lcm}; t=#{t_a - t_b}; #BLS=#{$num_BLS_sls}; #ELS=#{$num_ELS_sls}"
|
|
109
109
|
|
|
@@ -10,26 +10,26 @@ require 'test/unit'
|
|
|
10
10
|
|
|
11
11
|
class Test_ParamNameList_type_characteristics < Test::Unit::TestCase
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
include ::Pantheios::ApplicationLayer
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
def test_ParamNameList_type_exists
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
assert defined? ParamNameList
|
|
18
|
+
end
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
def test_ParamNames_type_exists
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
assert defined? ParamNames
|
|
23
|
+
end
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
def test_ParamNameList_type_is_a_class
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
assert ParamNameList.is_a? ::Class
|
|
28
|
+
end
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
def test_ParamNames_type_is_a_class
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
assert ParamNames.is_a? ::Class
|
|
33
|
+
end
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -10,161 +10,161 @@ require 'test/unit'
|
|
|
10
10
|
|
|
11
11
|
class Test_StockSeverityLevels < Test::Unit::TestCase
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
include ::Pantheios::ApplicationLayer
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
EXPECTED_LEVELS_PRIME = %w{
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
violation
|
|
18
|
+
alert
|
|
19
|
+
critical
|
|
20
|
+
failure
|
|
21
|
+
warning
|
|
22
|
+
notice
|
|
23
|
+
informational
|
|
24
|
+
debug0
|
|
25
|
+
debug1
|
|
26
|
+
debug2
|
|
27
|
+
debug3
|
|
28
|
+
debug4
|
|
29
|
+
debug5
|
|
30
|
+
trace
|
|
31
|
+
benchmark
|
|
32
|
+
}.map { |s| s.to_sym }
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
EXPECTED_LEVELS = %w{
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
emergency
|
|
37
|
+
fail
|
|
38
|
+
info
|
|
39
|
+
warn
|
|
40
|
+
}.map { |s| s.to_sym } + EXPECTED_LEVELS_PRIME
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
def test_StockSeverityLevels_type_exists
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
assert defined? StockSeverityLevels
|
|
45
|
+
end
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
def test_StockSeverityLevels_type_is_a_module
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
assert_kind_of(::Module, StockSeverityLevels) if defined?(StockSeverityLevels)
|
|
50
|
+
end
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
def test_StockSeverityLevels_has_constants
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
if defined? StockSeverityLevels
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
assert StockSeverityLevels.const_defined?(:STOCK_SEVERITY_LEVELS)
|
|
57
|
+
assert StockSeverityLevels.const_defined?(:STOCK_SEVERITY_LEVELS_PRIME)
|
|
58
|
+
assert StockSeverityLevels.const_defined?(:STOCK_SEVERITY_LEVEL_VALUES)
|
|
59
|
+
assert StockSeverityLevels.const_defined?(:STOCK_SEVERITY_LEVEL_STRINGS)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
def test_StockSeverityLevels_expected_levels
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
# all the ones that we expect exist
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
EXPECTED_LEVELS.each do |sev|
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
assert(StockSeverityLevels::STOCK_SEVERITY_LEVELS.include?(sev), "did not find level #{::Symbol === sev ? ':' : ''}#{sev} in #{StockSeverityLevels}::STOCK_SEVERITY_LEVELS")
|
|
70
|
+
end
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
# we expect all the ones that exist
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
StockSeverityLevels::STOCK_SEVERITY_LEVELS.each do |sev|
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
assert(EXPECTED_LEVELS.include?(sev), "found unexpected level #{::Symbol === sev ? ':' : ''}#{sev} in #{StockSeverityLevels}::STOCK_SEVERITY_LEVELS")
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
def test_StockSeverityLevels_expected_prime_levels
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
# all the ones that we expect exist
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
EXPECTED_LEVELS_PRIME.each do |sev|
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
assert(StockSeverityLevels::STOCK_SEVERITY_LEVELS_PRIME.include?(sev), "did not find level #{::Symbol === sev ? ':' : ''}#{sev} in #{StockSeverityLevels}::STOCK_SEVERITY_LEVELS")
|
|
87
|
+
end
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
# we expect all the ones that exist
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
StockSeverityLevels::STOCK_SEVERITY_LEVELS_PRIME.each do |sev|
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
assert(EXPECTED_LEVELS_PRIME.include?(sev), "found unexpected level #{::Symbol === sev ? ':' : ''}#{sev} in #{StockSeverityLevels}::STOCK_SEVERITY_LEVELS")
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
def test_StockSeverityLevels_expected_prime_levels_have_distinct_values
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
values = {}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
EXPECTED_LEVELS_PRIME.each do |sev|
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
value = StockSeverityLevels::STOCK_SEVERITY_LEVEL_VALUES[sev]
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
assert(false, "value #{value} for severity '#{sev}' is not unique") if values.has_key?(value)
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
values[value] = value
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
def test_StockSeverityLevels_expected_prime_levels_have_distinct_strings
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
strings = {}
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
EXPECTED_LEVELS_PRIME.each do |sev|
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
string = StockSeverityLevels::STOCK_SEVERITY_LEVEL_STRINGS[sev]
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
assert(false, "string '#{string}' for severity '#{sev}' is not unique") if strings.has_key?(string)
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
strings[string] = string
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
def test_StockSeverityLevels_aliases
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
aliases = StockSeverityLevels::STOCK_SEVERITY_LEVEL_ALIASES
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
assert_equal :violation, aliases[:violation]
|
|
130
|
+
assert_equal :violation, aliases[:emergency]
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
assert_equal :alert, aliases[:alert]
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
assert_equal :critical, aliases[:critical]
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
assert_equal :failure, aliases[:failure]
|
|
137
|
+
assert_equal :failure, aliases[:fail]
|
|
138
|
+
#assert_equal :failure, aliases[:error]
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
assert_equal :warning, aliases[:warning]
|
|
141
|
+
assert_equal :warning, aliases[:warn]
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
assert_equal :notice, aliases[:notice]
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
assert_equal :informational, aliases[:informational]
|
|
146
|
+
assert_equal :informational, aliases[:info]
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
%i{ debug0 debug1 debug2 debug3 debug4 debug5 }.each do |sev|
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
assert_equal sev, aliases[sev]
|
|
151
|
+
end
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
assert_equal :trace, aliases[:trace]
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
assert_equal :benchmark, aliases[:benchmark]
|
|
156
|
+
end
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
def test_StockSeverityLevels_recognised_values_are_nil
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
EXPECTED_LEVELS.each do |sev|
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
assert_not_nil StockSeverityLevels::STOCK_SEVERITY_LEVEL_VALUES[sev]
|
|
163
|
+
assert_nil StockSeverityLevels::STOCK_SEVERITY_LEVEL_VALUES[sev.to_s]
|
|
164
|
+
end
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
assert_nil StockSeverityLevels::STOCK_SEVERITY_LEVEL_VALUES[nil]
|
|
167
|
+
assert_nil StockSeverityLevels::STOCK_SEVERITY_LEVEL_VALUES['failure']
|
|
168
|
+
end
|
|
169
169
|
end
|
|
170
170
|
|
data/test/unit/core/tc_core_1.rb
CHANGED
|
@@ -10,45 +10,45 @@ require 'test/unit'
|
|
|
10
10
|
|
|
11
11
|
class Test_Core_set_process_name < Test::Unit::TestCase
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Core = ::Pantheios::Core
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
def test_derive_process_name_obtains_the_same_results_but_different_instances
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
begin
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Core.process_name = nil
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
n_1 = Core.process_name
|
|
22
|
+
n_2 = Core.process_name
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
assert_equal n_1, n_2
|
|
25
|
+
assert_same n_1, n_2
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Core.process_name = nil
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
n_3 = Core.process_name
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
assert_equal n_1, n_3
|
|
33
|
+
assert_not_same n_1, n_3
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
ensure
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
Core.process_name = nil
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
def test_derive_process_name_accepts_custom_value
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
begin
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Core.process_name = 'abc'
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
assert_equal 'abc', Core.process_name
|
|
48
|
+
ensure
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
Core.process_name = nil
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
53
|
end
|
|
54
54
|
|