Skip to content

Commit 6eadc01

Browse files
committed
Fix condition for UTF-8 default in magic_comment_spec.rb
1 parent 9888a3e commit 6eadc01

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

spec/ruby/language/magic_comment_spec.rb

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

4646
describe "Magic comments" do
4747
describe "in stdin" do
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
48+
default = (platform_is :windows and ruby_version_is "4.0") ? :UTF8 : :locale
49+
it_behaves_like :magic_comments, default, -> 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+
}
6153
end
6254

6355
platform_is_not :windows do

0 commit comments

Comments
 (0)