Skip to content

Commit e1516b5

Browse files
ashiekenhys
authored andcommitted
test_fluentd: Fix failed tests on Ruby 3.3
Signed-off-by: Takuro Ashie <[email protected]>
1 parent 98675e5 commit e1516b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: test/command/test_fluentd.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def multi_workers_ready?
941941
'-external-encoding' => '--external-encoding=utf-8',
942942
'-internal-encoding' => '--internal-encoding=utf-8',
943943
)
944-
test "-E option is set to RUBYOPT" do |opt|
944+
test "-E option is set to RUBYOPT" do |base_opt|
945945
conf = <<CONF
946946
<source>
947947
@type dummy
@@ -952,6 +952,7 @@ def multi_workers_ready?
952952
</match>
953953
CONF
954954
conf_path = create_conf_file('rubyopt_test.conf', conf)
955+
opt = base_opt.dup
955956
opt << " #{ENV['RUBYOPT']}" if ENV['RUBYOPT']
956957
assert_log_matches(
957958
create_cmdline(conf_path),
@@ -991,9 +992,14 @@ def multi_workers_ready?
991992
</match>
992993
CONF
993994
conf_path = create_conf_file('rubyopt_invalid_test.conf', conf)
995+
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('3.3.0')
996+
expected_phrase = 'ruby: invalid switch in RUBYOPT'
997+
else
998+
expected_phrase = 'Invalid option is passed to RUBYOPT'
999+
end
9941000
assert_log_matches(
9951001
create_cmdline(conf_path),
996-
'Invalid option is passed to RUBYOPT',
1002+
expected_phrase,
9971003
env: { 'RUBYOPT' => 'a' },
9981004
)
9991005
end

0 commit comments

Comments
 (0)