mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@519df35
This commit is contained in:
parent
31bb66a19d
commit
1c938a72aa
83 changed files with 1416 additions and 308 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue