Skip to content

Commit

Permalink
test_fluentd: Fix failed tests on Ruby 3.3
Browse files Browse the repository at this point in the history
Signed-off-by: Takuro Ashie <[email protected]>
  • Loading branch information
ashie authored and daipom committed Mar 11, 2024
1 parent 9796fd3 commit 48c2b05
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/command/test_fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ def multi_workers_ready?
'-external-encoding' => '--external-encoding=utf-8',
'-internal-encoding' => '--internal-encoding=utf-8',
)
test "-E option is set to RUBYOPT" do |opt|
test "-E option is set to RUBYOPT" do |base_opt|
conf = <<CONF
<source>
@type dummy
Expand All @@ -952,6 +952,7 @@ def multi_workers_ready?
</match>
CONF
conf_path = create_conf_file('rubyopt_test.conf', conf)
opt = base_opt.dup
opt << " #{ENV['RUBYOPT']}" if ENV['RUBYOPT']
assert_log_matches(
create_cmdline(conf_path),
Expand Down Expand Up @@ -991,9 +992,14 @@ def multi_workers_ready?
</match>
CONF
conf_path = create_conf_file('rubyopt_invalid_test.conf', conf)
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('3.3.0')
expected_phrase = 'ruby: invalid switch in RUBYOPT'
else
expected_phrase = 'Invalid option is passed to RUBYOPT'
end
assert_log_matches(
create_cmdline(conf_path),
'Invalid option is passed to RUBYOPT',
expected_phrase,
env: { 'RUBYOPT' => 'a' },
)
end
Expand Down

0 comments on commit 48c2b05

Please sign in to comment.