Skip to content

Commit

Permalink
Fix ParserTestDriver, FormatterTestDriver to let plugin instance alwa…
Browse files Browse the repository at this point in the history
…ys to have its class name
  • Loading branch information
sonots committed Jul 25, 2016
1 parent de13f7e commit c474488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/fluent/test/formatter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def initialize(klass_or_str, proc=nil, &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_or_str.name
klass_or_str = Class.new(klass_or_str)
klass_or_str.define_singleton_method("name") { klass_name }
klass_or_str.module_eval(&block)
end
@instance = klass_or_str.new
Expand Down
2 changes: 2 additions & 0 deletions lib/fluent/test/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def initialize(klass_or_str, format=nil, conf={}, &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_or_str.name
klass_or_str = Class.new(klass_or_str)
klass_or_str.define_singleton_method("name") { klass_name }
klass_or_str.module_eval(&block)
end
case klass_or_str.instance_method(:initialize).arity
Expand Down

0 comments on commit c474488

Please sign in to comment.