From 10cf4251ec7ebeb9a4379582d1d4466e6a67d02d Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Mon, 5 Feb 2018 09:23:31 -0600 Subject: [PATCH] Fix class name in reports --- src/testup/file_reporter.rb | 5 ++++- src/testup/reporter.rb | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/testup/file_reporter.rb b/src/testup/file_reporter.rb index 4001990..e36e353 100644 --- a/src/testup/file_reporter.rb +++ b/src/testup/file_reporter.rb @@ -75,7 +75,10 @@ def report def record(result) super - io.puts "%s#%s = %.2f s = %s" % [result.class, + unless instance_variable_defined? :@has_klass + @has_klass = result.instance_variable_defined? :@klass + end + io.puts "%s#%s = %.2f s = %s" % [@has_klass ? result.klass : result.class, result.name, result.time, result.result_code] diff --git a/src/testup/reporter.rb b/src/testup/reporter.rb index 6833d62..15dde64 100644 --- a/src/testup/reporter.rb +++ b/src/testup/reporter.rb @@ -59,8 +59,11 @@ def record(result) private def process_results(result) + unless instance_variable_defined? :@has_klass + @has_klass = result.instance_variable_defined? :@klass + end { - :testname => "#{result.class.name}##{result.name}", + :testname => "#{@has_klass ? result.klass : result.class}##{result.name}", :time => result.time, :skipped => result.skipped?, :error => result.error?,