зеркало из https://github.com/github/ruby.git
Update to ruby/spec@94d98ff
This commit is contained in:
Родитель
632a97227e
Коммит
a2091c3023
|
@ -47,7 +47,7 @@ describe "Array#pack with format 'B'" do
|
|||
].should be_computed_by(:pack, "B*")
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
["1"].pack("B").encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
||||
|
@ -98,7 +98,7 @@ describe "Array#pack with format 'b'" do
|
|||
].should be_computed_by(:pack, "b*")
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
["1"].pack("b").encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ describe "Array#pack with format 'H'" do
|
|||
].should be_computed_by(:pack, "H")
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
["41"].pack("H").encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
@ -194,7 +194,7 @@ describe "Array#pack with format 'h'" do
|
|||
].should be_computed_by(:pack, "h")
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
["41"].pack("h").encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@ describe :array_pack_numeric_basic, shared: true do
|
|||
lambda { [false].pack(pack_format) }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
[0xFF].pack(pack_format).encoding.should == Encoding::BINARY
|
||||
[0xE3, 0x81, 0x82].pack(pack_format(3)).encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@ describe "Array#pack with format 'w'" do
|
|||
lambda { [-1].pack("w") }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "returns an BINARY string" do
|
||||
it "returns a binary string" do
|
||||
[1].pack('w').encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ describe "Integer#chr without argument" do
|
|||
end
|
||||
|
||||
describe "and self is between 128 and 255 (inclusive)" do
|
||||
it "returns an BINARY String" do
|
||||
it "returns a binary String" do
|
||||
(128..255).each do |c|
|
||||
c.chr.encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ describe "Integer#chr without argument" do
|
|||
end
|
||||
|
||||
describe "and self is between 128 and 255 (inclusive)" do
|
||||
it "returns an BINARY String" do
|
||||
it "returns a binary String" do
|
||||
(128..255).each do |c|
|
||||
Encoding.default_internal = Encoding::UTF_8
|
||||
c.chr.encoding.should == Encoding::BINARY
|
||||
|
|
|
@ -4,7 +4,7 @@ describe :proc_to_s, shared: true do
|
|||
Proc.new { "hello" }.send(@method).should =~ /^#<Proc:([^ ]*?)(@([^ ]*)\/to_s\.rb:4)?>$/
|
||||
end
|
||||
|
||||
it "has an BINARY encoding" do
|
||||
it "has a binary encoding" do
|
||||
Proc.new { "hello" }.send(@method).encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ describe :proc_to_s, shared: true do
|
|||
lambda { "hello" }.send(@method).should =~ /^#<Proc:([^ ]*?)(@([^ ]*)\/to_s\.rb:10)? \(lambda\)>$/
|
||||
end
|
||||
|
||||
it "has an BINARY encoding" do
|
||||
it "has a binary encoding" do
|
||||
lambda { "hello" }.send(@method).encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
@ -24,7 +24,7 @@ describe :proc_to_s, shared: true do
|
|||
proc { "hello" }.send(@method).should =~ /^#<Proc:([^ ]*?)(@([^ ]*)\/to_s\.rb:16)?>$/
|
||||
end
|
||||
|
||||
it "has an BINARY encoding" do
|
||||
it "has a binary encoding" do
|
||||
proc { "hello" }.send(@method).encoding.should == Encoding::BINARY
|
||||
end
|
||||
end
|
||||
|
@ -35,7 +35,7 @@ describe :proc_to_s, shared: true do
|
|||
method("hello").to_proc.send(@method).should =~ /^#<Proc:([^ ]*?)(@([^ ]*)\/to_s\.rb:22)? \(lambda\)>$/
|
||||
end
|
||||
|
||||
it "has an BINARY encoding" do
|
||||
it "has a binary encoding" do
|
||||
def hello; end
|
||||
method("hello").to_proc.send(@method).encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ describe :proc_to_s, shared: true do
|
|||
proc.send(@method).should =~ /^#<Proc:0x\h+\(&:foobar\)>$/
|
||||
end
|
||||
|
||||
it "has an BINARY encoding" do
|
||||
it "has a binary encoding" do
|
||||
proc = :foobar.to_proc
|
||||
proc.send(@method).encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ describe :random_bytes, shared: true do
|
|||
@object.bytes(15).length.should == 15
|
||||
end
|
||||
|
||||
it "returns an BINARY String" do
|
||||
it "returns a binary String" do
|
||||
@object.bytes(15).encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ describe :random_urandom, shared: true do
|
|||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "returns an BINARY String" do
|
||||
it "returns a binary String" do
|
||||
Random.send(@method, 15).encoding.should == Encoding::BINARY
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#b" do
|
||||
it "returns an BINARY encoded string" do
|
||||
it "returns a binary encoded string" do
|
||||
"Hello".b.should == "Hello".force_encoding(Encoding::BINARY)
|
||||
"こんちには".b.should == "こんちには".force_encoding(Encoding::BINARY)
|
||||
end
|
||||
|
|
|
@ -676,7 +676,7 @@ describe :rb_external_str_new, shared: true do
|
|||
@s.send(@method, "abc").encoding.should == Encoding::UTF_8
|
||||
end
|
||||
|
||||
it "returns an BINARY encoded string if any non-ascii bytes are present and default external is US-ASCII" do
|
||||
it "returns a binary encoded string if any non-ascii bytes are present and default external is US-ASCII" do
|
||||
Encoding.default_external = "US-ASCII"
|
||||
x80 = [0x80].pack('C')
|
||||
@s.send(@method, "#{x80}abc").encoding.should == Encoding::BINARY
|
||||
|
@ -735,7 +735,7 @@ describe "C-API String function" do
|
|||
s.encoding.should == Encoding::UTF_8
|
||||
end
|
||||
|
||||
it "returns an BINARY encoded String if any non-ascii bytes are present and the specified encoding is US-ASCII" do
|
||||
it "returns a binary encoded String if any non-ascii bytes are present and the specified encoding is US-ASCII" do
|
||||
x80 = [0x80].pack('C')
|
||||
s = @s.rb_external_str_new_with_enc("#{x80}abc", 4, Encoding::US_ASCII)
|
||||
s.encoding.should == Encoding::BINARY
|
||||
|
|
Загрузка…
Ссылка в новой задаче