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
|
@@ -16,118 +16,118 @@ require 'stringio'
|
|
|
16
16
|
|
|
17
17
|
class Test_SimpleConsoleLogservice < Test::Unit::TestCase
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
include ::Pantheios::Services
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
def test_SimpleConsoleLogService_type_exists
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
assert defined? SimpleConsoleLogService
|
|
24
|
+
end
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
if defined?(SimpleConsoleLogService)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
def self.log_and_get_streams sev, msg, pref = nil, t = nil
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
prev_stdout, prev_stderr = $stdout, $stderr
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
begin
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
$stdout = StringIO.new
|
|
35
|
+
$stderr = StringIO.new
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
svc = SimpleConsoleLogService.new
|
|
38
|
+
t ||= Time.now
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
svc.log sev, t, pref, msg
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
[ $stdout.string, $stderr.string ]
|
|
43
|
+
ensure
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
$stdout, $stderr = prev_stdout, prev_stderr
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
def test_SimpleConsoleLogService_type_is_a_class
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
assert_kind_of(::Class, SimpleConsoleLogService)
|
|
52
|
+
end
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
def test_SimpleConsoleLogService_type_has_expected_instance_methods
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
assert_type_has_instance_methods SimpleConsoleLogService, [ :severity_logged?, :log ]
|
|
57
|
+
end
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
def test_severity_logged_false_with_large_range_of_integers
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
svc = SimpleConsoleLogService.new
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
(-10000 .. 10000).each do |sev|
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
assert_true(svc.severity_logged?(sev), "severity '#{sev}' (#{sev.class}) was not logged")
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
def test_severity_logged_false_with_stock_severity_levels
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
svc = SimpleConsoleLogService.new
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
::Pantheios::ApplicationLayer::StockSeverityLevels::STOCK_SEVERITY_LEVELS.each do |sev|
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
assert_true(svc.severity_logged?(sev), "severity '#{sev}' (#{sev.class}) was not logged")
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
def test_log_writes_to_standard_streams
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
prev_stdout, prev_stderr = $stdout, $stderr
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
begin
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
$stdout = StringIO.new
|
|
86
|
+
$stderr = StringIO.new
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
svc = SimpleConsoleLogService.new
|
|
89
|
+
t = Time.now
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
(-1000..1000).each do |sev|
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
svc.log sev, t, 'some-prefix', 'some-message'
|
|
94
|
+
end
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
stdout_s = $stdout.string
|
|
97
|
+
stderr_s = $stderr.string
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
assert_empty stdout_s, "SimpleConsoleLogService has written to $stdout!"
|
|
100
|
+
assert_not_empty stderr_s, "SimpleConsoleLogService has not written to $stderr!"
|
|
101
|
+
ensure
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
$stdout, $stderr = prev_stdout, prev_stderr
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
def test_writing_to_streams_based_on_severities
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
r = nil
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
stderr_levels = %w{ violation emergency alert critical failure warning warn }.map { |s| s.to_sym }
|
|
112
|
+
stdout_levels = %w{ notice informational info debug0 debug1 debug2 debug3 debug4 trace }.map { |s| s.to_sym }
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
stderr_levels.each do |sev|
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
r = self.class.log_and_get_streams sev, 'msg'
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
assert_empty r[0], "SimpleConsoleLogService wrote unexpectedly to $stdout for severity #{sev}"
|
|
119
|
+
assert_not_empty r[1], "SimpleConsoleLogService failed to write to $stderr for severity #{sev}"
|
|
120
|
+
end
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
stdout_levels.each do |sev|
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
r = self.class.log_and_get_streams sev, 'msg'
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
assert_empty r[0], "SimpleConsoleLogService wrote to $stdout for severity #{sev}"
|
|
127
|
+
assert_not_empty r[1], "SimpleConsoleLogService failed to write to $stderr for severity #{sev}"
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
|
|
@@ -17,236 +17,236 @@ require 'tempfile'
|
|
|
17
17
|
|
|
18
18
|
class Test_SimpleFileLogservice < Test::Unit::TestCase
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
include ::Pantheios::Services
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
def test_SimpleFileLogService_type_exists
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
assert defined? SimpleFileLogService
|
|
25
|
+
end
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
if defined?(SimpleFileLogService)
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
def self.log_to_StringIO_and_get_output messages, def_sev, def_pref = nil, def_t = nil, **options
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
def_t ||= Time.now
|
|
32
|
+
def_pref ||= "[prog, thread, #{def_t}]: "
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
stream = StringIO.new
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
svc = SimpleFileLogService.new stream, **options
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
messages.each do |message|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
ar = ::Array === message ? message : [ message ]
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
msg = ar[0]
|
|
43
|
+
sev = ar[1] || def_sev
|
|
44
|
+
pref = ar[2] || def_pref
|
|
45
|
+
t = ar[3] || def_t
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
svc.log sev, t, pref, msg
|
|
48
|
+
end
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
stream.string
|
|
51
|
+
end
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
def self.log_to_Tempfile_and_get_output messages, def_sev, def_pref = nil, def_t = nil, **options
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
def_t ||= Time.now
|
|
56
|
+
def_pref ||= "[prog, thread, #{def_t}]: "
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
tf = Tempfile.new 'Pantheios.Ruby.Tempfile'
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
begin
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
svc = SimpleFileLogService.new tf, **options
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
messages.each do |message|
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
ar = ::Array === message ? message : [ message ]
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
msg = ar[0]
|
|
69
|
+
sev = ar[1] || def_sev
|
|
70
|
+
pref = ar[2] || def_pref
|
|
71
|
+
t = ar[3] || def_t
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
svc.log sev, t, pref, msg
|
|
74
|
+
end
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
tf.rewind
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
return tf.read
|
|
79
|
+
ensure
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
tf.close
|
|
82
|
+
tf.unlink
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
def self.log_to_Tempfile_path_and_get_output messages, def_sev, def_pref = nil, def_t = nil, **options
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
def_t ||= Time.now
|
|
89
|
+
def_pref ||= "[prog, thread, #{def_t}]: "
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
tf = Tempfile.new 'Pantheios.Ruby.Tempfile'
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
begin
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
svc = SimpleFileLogService.new tf.path, **options
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
messages.each do |message|
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
ar = ::Array === message ? message : [ message ]
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
msg = ar[0]
|
|
102
|
+
sev = ar[1] || def_sev
|
|
103
|
+
pref = ar[2] || def_pref
|
|
104
|
+
t = ar[3] || def_t
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
svc.log sev, t, pref, msg
|
|
107
|
+
end
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
tf.rewind
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
return tf.read
|
|
112
|
+
ensure
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
tf.close
|
|
115
|
+
tf.unlink
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
def test_SimpleFileLogService_type_is_a_class
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
assert_kind_of(::Class, SimpleFileLogService)
|
|
122
|
+
end
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
def test_SimpleFileLogService_type_has_expected_instance_methods
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
assert_type_has_instance_methods SimpleFileLogService, [ :severity_logged?, :log ]
|
|
127
|
+
end
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
def test_ctor_failures_with_invalid_log_file_or_path
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
assert_raise_with_message(::ArgumentError, /log_file_or_path.*not.*nil/) { SimpleFileLogService.new nil }
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
assert_raise_with_message(::TypeError, [ /log_file_or_path.*must be/, /::File/, /::IO/, /::String/, /::StringIO/ ]) { SimpleFileLogService.new(//) }
|
|
134
|
+
end
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
def test_ctor_failures_with_invalid_options
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
assert_raise_with_message(::ArgumentError, /:roll_depth.*non.*negative.*integer/) { SimpleFileLogService.new '/dev/null', roll_depth: true }
|
|
139
|
+
assert_raise_with_message(::ArgumentError, /:roll_depth.*non.*negative.*integer/) { SimpleFileLogService.new '/dev/null', roll_depth: -1 }
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
assert_raise_with_message(::ArgumentError, /:roll_size.*non.*negative.*integer/) { SimpleFileLogService.new '/dev/null', roll_size: true }
|
|
142
|
+
assert_raise_with_message(::ArgumentError, /:roll_size.*non.*negative.*integer/) { SimpleFileLogService.new '/dev/null', roll_size: -1 }
|
|
143
|
+
end
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
def test_severity_logged_false_with_large_range_of_integers
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
output = StringIO.new
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
svc = SimpleFileLogService.new output
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
(-10000 .. 10000).each do |sev|
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
assert_true(svc.severity_logged?(sev), "severity '#{sev}' (#{sev.class}) was not logged")
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
def test_simple_logging_with_StringIO_1
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
message = 'msg'
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
output = self.class.log_to_StringIO_and_get_output [ message ], :notice, nil, nil
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
lines = output.split(/\n/)
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
assert_not_empty lines
|
|
166
|
+
assert_equal 1, lines.size
|
|
167
|
+
assert_match(/msg$/, lines[0])
|
|
168
|
+
end
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
def test_simple_logging_with_StringIO_2
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
msgs = [
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
[ 'msg-1' ],
|
|
175
|
+
[ 'msg-2' ],
|
|
176
|
+
]
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
output = self.class.log_to_StringIO_and_get_output msgs, :notice, nil, nil
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
lines = output.split(/\n/)
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
assert_not_empty lines
|
|
183
|
+
assert_equal 2, lines.size
|
|
184
|
+
assert_match(/msg-1$/, lines[0])
|
|
185
|
+
assert_match(/msg-2$/, lines[1])
|
|
186
|
+
end
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
def test_simple_logging_with_Tempfile_1
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
message = 'msg'
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
output = self.class.log_to_Tempfile_and_get_output [ message ], :notice, nil, nil
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
lines = output.split(/\n/)
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
assert_not_empty lines
|
|
197
|
+
assert_equal 1, lines.size
|
|
198
|
+
assert_match(/msg$/, lines[0])
|
|
199
|
+
end
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
def test_simple_logging_with_Tempfile_2
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
msgs = [
|
|
204
204
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
[ 'msg-1' ],
|
|
206
|
+
[ 'msg-2' ],
|
|
207
|
+
]
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
output = self.class.log_to_Tempfile_and_get_output msgs, :notice, nil, nil
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
lines = output.split(/\n/)
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
assert_not_empty lines
|
|
214
|
+
assert_equal 2, lines.size
|
|
215
|
+
assert_match(/msg-1$/, lines[0])
|
|
216
|
+
assert_match(/msg-2$/, lines[1])
|
|
217
|
+
end
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
def test_simple_logging_with_Tempfile_path_1
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
message = 'msg'
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
output = self.class.log_to_Tempfile_path_and_get_output [ message ], :notice, nil, nil
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
lines = output.split(/\n/)
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
assert_not_empty lines
|
|
228
|
+
assert_equal 1, lines.size
|
|
229
|
+
assert_match(/msg$/, lines[0])
|
|
230
|
+
end
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
def test_simple_logging_with_Tempfile_path_2
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
msgs = [
|
|
235
235
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
[ 'msg-1' ],
|
|
237
|
+
[ 'msg-2' ],
|
|
238
|
+
]
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
output = self.class.log_to_Tempfile_path_and_get_output msgs, :notice, nil, nil
|
|
241
241
|
|
|
242
|
-
|
|
242
|
+
lines = output.split(/\n/)
|
|
243
243
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
assert_not_empty lines
|
|
245
|
+
assert_equal 2, lines.size
|
|
246
|
+
assert_match(/msg-1$/, lines[0])
|
|
247
|
+
assert_match(/msg-2$/, lines[1])
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
250
|
end
|
|
251
251
|
|
|
252
252
|
|