Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate out_null plugin to v0.14 API #1057

Merged
merged 4 commits into from
Jun 23, 2016

Conversation

okkez
Copy link
Contributor

@okkez okkez commented Jun 17, 2016

No description provided.

@cosmo0920
Copy link
Contributor

cosmo0920 commented Jun 17, 2016

I think that adding the following patch into test driver and test assertion is better:

diff --git a/lib/fluent/test/driver/base.rb b/lib/fluent/test/driver/base.rb
index 229acc1..e52b776 100644
--- a/lib/fluent/test/driver/base.rb
+++ b/lib/fluent/test/driver/base.rb
@@ -106,6 +106,7 @@ module Fluent
         end

         def events(tag: nil)
+          return [] if @event_streams.nil?
           selected = @event_streams.select{|e| tag.nil? ? true : e.tag == tag }
           if block_given?
             selected.each do |e|
diff --git a/test/plugin/test_out_null.rb b/test/plugin/test_out_null.rb
index a3f3815..ab47021 100644
--- a/test/plugin/test_out_null.rb
+++ b/test/plugin/test_out_null.rb
@@ -24,5 +24,6 @@ class NullOutputTest < Test::Unit::TestCase
         d.feed("test", Fluent::EventTime.now, {"test" => "null"})
       end
     end
+    assert_equal([], d.events)
   end
 end

@okkez
Copy link
Contributor Author

okkez commented Jun 17, 2016

Thanks I've added your patch @cosmo0920

@tagomoris
Copy link
Member

Looks very good to me. Thank you!

@tagomoris tagomoris merged commit e6f1eb1 into fluent:master Jun 23, 2016
@okkez okkez deleted the migrate-v0.14-api-out_null branch October 24, 2016 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants