diff options
Diffstat (limited to 'spec/ruby/core/array/shared/join.rb')
-rw-r--r-- | spec/ruby/core/array/shared/join.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/array/shared/join.rb b/spec/ruby/core/array/shared/join.rb index 5e7193de8a..c443d9a628 100644 --- a/spec/ruby/core/array/shared/join.rb +++ b/spec/ruby/core/array/shared/join.rb @@ -113,6 +113,20 @@ describe :array_join_with_default_separator, shared: true do -> { ary_utf8_bad_binary.send(@method) }.should raise_error(EncodingError) end + + ruby_version_is "2.7" do + context "when $, is not nil" do + before do + suppress_warning do + $, = '*' + end + end + + it "warns" do + -> { [].join }.should complain(/warning: \$, is set to non-nil value/) + end + end + end end describe :array_join_with_string_separator, shared: true do |