1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

io.c: warn non-nil $,

* array.c (rb_ary_join_m): warn use of non-nil $,.

* io.c (rb_output_fs_setter): warn when set to non-nil value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-04-18 21:56:55 +00:00
parent 4751caecc3
commit 3ee0648dc7
9 changed files with 41 additions and 19 deletions

View file

@ -19,8 +19,10 @@ describe :array_join_with_default_separator, shared: true do
end
it "returns a string formed by concatenating each String element separated by $," do
$, = " | "
["1", "2", "3"].send(@method).should == "1 | 2 | 3"
suppress_warning {
$, = " | "
["1", "2", "3"].send(@method).should == "1 | 2 | 3"
}
end
it "attempts coercion via #to_str first" do