Skip to content

Commit 50830ce

Browse files
committed
stdin seems always treated as UTF-8 on Ruby 4.0 on Windows
1 parent 8017c62 commit 50830ce

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

language/magic_comment_spec.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,19 @@
4545

4646
describe "Magic comments" do
4747
describe "in stdin" do
48-
it_behaves_like :magic_comments, :locale, -> file {
49-
print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb")
50-
ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}")
51-
}
48+
ruby_version_is ""..."4.0" do
49+
it_behaves_like :magic_comments, :locale, -> file {
50+
print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb")
51+
ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}")
52+
}
53+
end
54+
55+
ruby_version_is "4.0" do
56+
it_behaves_like :magic_comments, :UTF8, -> file {
57+
print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb")
58+
ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}")
59+
}
60+
end
5261
end
5362

5463
platform_is_not :windows do

0 commit comments

Comments
 (0)