diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2026-01-04 18:13:08 +0100 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2026-01-04 18:13:08 +0100 |
| commit | 6eadc01cdaa70895d464843de5b6c4d35cab2e27 (patch) | |
| tree | 520c8e7e7cc5d9d527d199abbcf7a52d4ad40f8a /spec | |
| parent | 9888a3e8bda75a417f15e3936d5d9a16051c9256 (diff) | |
Fix condition for UTF-8 default in magic_comment_spec.rb
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/ruby/language/magic_comment_spec.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/spec/ruby/language/magic_comment_spec.rb b/spec/ruby/language/magic_comment_spec.rb index 90bb83e279..af9c9dbfd0 100644 --- a/spec/ruby/language/magic_comment_spec.rb +++ b/spec/ruby/language/magic_comment_spec.rb @@ -45,19 +45,11 @@ end describe "Magic comments" do describe "in stdin" do - ruby_version_is ""..."4.0" do - it_behaves_like :magic_comments, :locale, -> file { - print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb") - ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}") - } - end - - ruby_version_is "4.0" do - it_behaves_like :magic_comments, :UTF8, -> file { - print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb") - ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}") - } - end + default = (platform_is :windows and ruby_version_is "4.0") ? :UTF8 : :locale + it_behaves_like :magic_comments, default, -> file { + print_at_exit = fixture(__FILE__, "print_magic_comment_result_at_exit.rb") + ruby_exe(nil, args: "< #{fixture(__FILE__, file)}", options: "-r#{print_at_exit}") + } end platform_is_not :windows do |
