1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-09-29 16:03:58 +02:00
parent 31bb66a19d
commit 1c938a72aa
83 changed files with 1416 additions and 308 deletions

View file

@ -15,10 +15,10 @@ describe "Encoding::Converter#convpath" do
end
it "indicates if crlf_newline conversion would occur" do
ec = Encoding::Converter.new("ISo-8859-1", "EUC-JP", {crlf_newline: true})
ec = Encoding::Converter.new("ISo-8859-1", "EUC-JP", crlf_newline: true)
ec.convpath.last.should == "crlf_newline"
ec = Encoding::Converter.new("ASCII", "UTF-8", {crlf_newline: false})
ec = Encoding::Converter.new("ASCII", "UTF-8", crlf_newline: false)
ec.convpath.last.should_not == "crlf_newline"
end
end

View file

@ -50,7 +50,7 @@ describe "Encoding::Converter.new" do
it "calls #to_hash to convert the options argument to a Hash if not a Fixnum" do
opts = mock("encoding converter options")
opts.should_receive(:to_hash).and_return({ replace: "fubar" })
conv = Encoding::Converter.new("us-ascii", "utf-8", opts)
conv = Encoding::Converter.new("us-ascii", "utf-8", **opts)
conv.replacement.should == "fubar"
end

View file

@ -85,7 +85,7 @@ describe "Encoding::Converter#primitive_convert" do
end
it "accepts an options hash" do
@ec.primitive_convert("","",nil,nil, {after_output: true}).should == :finished
@ec.primitive_convert("","",nil,nil, after_output: true).should == :finished
end
it "sets the destination buffer's encoding to the destination encoding if the conversion succeeded" do

View file

@ -15,12 +15,10 @@ describe "Encoding::Converter.search_convpath" do
end
it "indicates if crlf_newline conversion would occur" do
cp = Encoding::Converter.search_convpath(
"ISO-8859-1", "EUC-JP", {crlf_newline: true})
cp = Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", crlf_newline: true)
cp.last.should == "crlf_newline"
cp = Encoding::Converter.search_convpath(
"ASCII", "UTF-8", {crlf_newline: false})
cp = Encoding::Converter.search_convpath("ASCII", "UTF-8", crlf_newline: false)
cp.last.should_not == "crlf_newline"
end