mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 18:50:12 +01:00
Upgraded to open_id_authentication plugin at 00d8bc7f97 and unpacked ruby-openid gem version 2.1.2.
This commit is contained in:
parent
6149900e0c
commit
e92dae2ffc
227 changed files with 30857 additions and 669 deletions
53
vendor/gems/ruby-openid-2.1.2/test/util.rb
vendored
Normal file
53
vendor/gems/ruby-openid-2.1.2/test/util.rb
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Utilities that are only used in the testing code
|
||||
require 'stringio'
|
||||
|
||||
module OpenID
|
||||
module TestUtil
|
||||
def assert_log_matches(*regexes)
|
||||
begin
|
||||
old_logger = Util.logger
|
||||
log_output = StringIO.new
|
||||
Util.logger = Logger.new(log_output)
|
||||
result = yield
|
||||
ensure
|
||||
Util.logger = old_logger
|
||||
end
|
||||
log_output.rewind
|
||||
log_lines = log_output.readlines
|
||||
assert_equal(regexes.length, log_lines.length,
|
||||
[regexes, log_lines].inspect)
|
||||
log_lines.zip(regexes) do |line, regex|
|
||||
assert_match(regex, line)
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def assert_log_line_count(num_lines)
|
||||
begin
|
||||
old_logger = Util.logger
|
||||
log_output = StringIO.new
|
||||
Util.logger = Logger.new(log_output)
|
||||
result = yield
|
||||
ensure
|
||||
Util.logger = old_logger
|
||||
end
|
||||
log_output.rewind
|
||||
log_lines = log_output.readlines
|
||||
assert_equal(num_lines, log_lines.length)
|
||||
result
|
||||
end
|
||||
|
||||
def silence_logging
|
||||
begin
|
||||
old_logger = Util.logger
|
||||
log_output = StringIO.new
|
||||
Util.logger = Logger.new(log_output)
|
||||
result = yield
|
||||
ensure
|
||||
Util.logger = old_logger
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue