diff --git a/lib/fluent/test/driver/base.rb b/lib/fluent/test/driver/base.rb index 4a45d3b6a1..d087f72dcd 100644 --- a/lib/fluent/test/driver/base.rb +++ b/lib/fluent/test/driver/base.rb @@ -31,7 +31,9 @@ def initialize(klass, opts: {}, &block) if block # Create new class for test w/ overwritten methods # klass.dup is worse because its ancestors does NOT include original class name + klass_name = klass.name klass = Class.new(klass) + klass.define_singleton_method("name") { klass_name } klass.module_eval(&block) end @instance = klass.new