69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# File 'lib/webconsole/logger/test/tc_logger.rb', line 69
def test_logger
test_count = 0
message = "Testing log error"
@logger.error(message)
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class
assert_equal("error", test_class, "The classes should match")
result_count = @test_view_helper.number_of_log_messages
test_count += 1
assert_equal(test_count, result_count, "The number of log messages should match")
message = "Testing log message"
@logger.info(message)
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class
assert_equal("message", test_class, "The classes should match")
result_count = @test_view_helper.number_of_log_messages
test_count += 1
assert_equal(test_count, result_count, "The number of log messages should match")
message = WebConsole::Logger::ERROR_PREFIX.rstrip @logger.info(message)
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class
assert_equal("message", test_class, "The classes should match")
result_count = @test_view_helper.number_of_log_messages
test_count += 1
assert_equal(test_count, result_count, "The number of log messages should match")
message = WebConsole::Logger::MESSAGE_PREFIX.rstrip @logger.info(message)
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class
assert_equal("message", test_class, "The classes should match")
result_count = @test_view_helper.number_of_log_messages
test_count += 1
assert_equal(test_count, result_count, "The number of log messages should match")
@logger.info(" \t")
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message()
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class()
assert_equal("message", test_class, "The classes should match")
@logger.info("")
sleep WebConsole::Tests::TEST_PAUSE_TIME test_message = @test_view_helper.last_log_message()
assert_equal(message, test_message, "The messages should match")
test_class = @test_view_helper.last_log_class()
assert_equal("message", test_class, "The classes should match")
end
|