Skip to content

Commit

Permalink
out_copy: test: Assert ignore_if_prev_success function calling
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Mar 8, 2021
1 parent c796d8a commit 762ad71
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/plugin/test_out_copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
require 'fluent/test/driver/multi_output'
require 'fluent/plugin/out_copy'
require 'fluent/event'
require 'flexmock/test_unit'

class CopyOutputTest < Test::Unit::TestCase
include FlexMock::TestCase

class << self
def startup
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'scripts'))
Expand Down Expand Up @@ -241,6 +244,16 @@ def test_ignore_if_prev_success
raise ArgumentError, 'Failed'
end

# check ingore_if_prev_success functionality:
# 1. output 2 is succeeded.
# 2. output 3 is not cailed.
flexstub(d.instance.outputs[1]) do |output|
output.should_receive(:process).once
end
flexstub(d.instance.outputs[2]) do |output|
output.should_receive(:process).never
end

time = Time.parse("2011-01-02 13:14:15 UTC").to_i
assert_nothing_raised do
d.run(default_tag: 'test') do
Expand Down

0 comments on commit 762ad71

Please sign in to comment.