aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-03-22 17:40:15 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-03-22 17:40:15 +0000
commit2622cd5d2cb322b78229d345d82076a582925ae2 (patch)
tree2e7349408ebf9fc8ea6bfd206b8499830a3c9580
parent499c144b8cfd973d3766fd81a4e702aa0013de0e (diff)
Updated a couple of test helpers.
-rw-r--r--test/th_mauve.rb2
-rw-r--r--test/th_mauve_resolv.rb8
2 files changed, 8 insertions, 2 deletions
diff --git a/test/th_mauve.rb b/test/th_mauve.rb
index 7972b9d..2b97e64 100644
--- a/test/th_mauve.rb
+++ b/test/th_mauve.rb
@@ -69,7 +69,7 @@ module Mauve
@logger = Log4r::Logger.new 'Mauve'
@outputter = Mauve::TestOutputter.new("test")
@outputter.formatter = Log4r::PatternFormatter.new( :pattern => "%d %l %m" )
- @outputter.level = Log4r::WARN
+ @outputter.level = ($debug ? Log4r::DEBUG : Log4r::WARN)
@logger.outputters << @outputter
return @logger
end
diff --git a/test/th_mauve_resolv.rb b/test/th_mauve_resolv.rb
index 98b597b..10bdacc 100644
--- a/test/th_mauve_resolv.rb
+++ b/test/th_mauve_resolv.rb
@@ -14,13 +14,19 @@ module Mauve
alias_method :get_ips_for_without_testing, :get_ips_for
def get_ips_for_with_testing(host)
+
lookup = {
"test-1.example.com" => %w(1.2.3.4 2001:1:2:3::4),
"test-2.example.com" => %w(1.2.3.5 2001:1:2:3::5),
"www.example.com" => %w(1.2.3.4),
"www2.example.com" => %w(1.2.3.5 2001:2::2)
}
- lookup[host] || get_ips_for_without_testing(host)
+ if lookup.has_key?(host)
+ self.count += lookup[host].length if $debug
+ lookup[host]
+ else
+ get_ips_for_without_testing(host)
+ end
end
alias_method :get_ips_for, :get_ips_for_with_testing