1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2019-02-07 16:35:33 +00:00
parent 5c7c6763f6
commit 75334db3c6
111 changed files with 1031 additions and 231 deletions

View file

@ -58,7 +58,7 @@ describe "Array#combination" do
@array.combination(-1).size.should == 0
[].combination(-2).size.should == 0
end
it "returns the binomial coeficient between the array size the number of combinations" do
it "returns the binomial coefficient between the array size the number of combinations" do
@array.combination(5).size.should == 0
@array.combination(4).size.should == 1
@array.combination(3).size.should == 4

View file

@ -81,7 +81,7 @@ module ArraySpecs
end
end
class ArrayConvertable
class ArrayConvertible
attr_accessor :called
def initialize(*values, &block)
@values = values;
@ -426,7 +426,7 @@ module ArraySpecs
"assert_no_queries",
"test_change_column_quotes_column_names",
"assert_match",
"test_keeping_default_and_notnull_constaint_on_change",
"test_keeping_default_and_notnull_constraint_on_change",
"methods",
"connection_allow_concurrency_setup",
"connection_allow_concurrency_teardown",
@ -476,7 +476,7 @@ module ArraySpecs
"test_create_table_without_id",
"test_finds_migrations",
"test_finds_pending_migrations",
"test_keeping_default_and_notnull_constaint_on_change",
"test_keeping_default_and_notnull_constraint_on_change",
"test_migrator",
"test_migrator_db_has_no_schema_migrations_table",
"test_migrator_double_down",

View file

@ -53,7 +53,7 @@ describe "Array#last" do
array.last.should equal(array)
end
it "tries to convert the passed argument to an Integer usinig #to_int" do
it "tries to convert the passed argument to an Integer using #to_int" do
obj = mock('to_int')
obj.should_receive(:to_int).and_return(2)
[1, 2, 3, 4, 5].last(obj).should == [4, 5]

View file

@ -41,16 +41,9 @@ describe :array_pack_float_le, shared: true do
[-infinity_value].pack(pack_format).should == "\x00\x00\x80\xff"
end
platform_is "86" do # x86 / x86_64
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x00\x00\xc0\xff"
end
end
platform_is "powerpc64" do
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x00\x00\xc0\x7f"
end
it "encodes NaN" do
nans = ["\x00\x00\xc0\xff", "\x00\x00\xc0\x7f"]
nans.should include([nan_value].pack(pack_format))
end
it "encodes a positive Float outside the range of a single precision float" do
@ -103,16 +96,9 @@ describe :array_pack_float_be, shared: true do
[-infinity_value].pack(pack_format).should == "\xff\x80\x00\x00"
end
platform_is "86" do # x86 / x86_64
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\xff\xc0\x00\x00"
end
end
platform_is "powerpc64" do
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x7f\xc0\x00\x00"
end
it "encodes NaN" do
nans = ["\xff\xc0\x00\x00", "\x7f\xc0\x00\x00"]
nans.should include([nan_value].pack(pack_format))
end
it "encodes a positive Float outside the range of a single precision float" do
@ -165,16 +151,9 @@ describe :array_pack_double_le, shared: true do
[-infinity_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf0\xff"
end
platform_is "86" do # x86 / x86_64
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf8\xff"
end
end
platform_is "powerpc64" do
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf8\x7f"
end
it "encodes NaN" do
nans = ["\x00\x00\x00\x00\x00\x00\xf8\xff", "\x00\x00\x00\x00\x00\x00\xf8\x7f"]
nans.should include([nan_value].pack(pack_format))
end
it "encodes a positive Float outside the range of a single precision float" do
@ -227,16 +206,9 @@ describe :array_pack_double_be, shared: true do
[-infinity_value].pack(pack_format).should == "\xff\xf0\x00\x00\x00\x00\x00\x00"
end
platform_is "86" do # x86 / x86_64
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\xff\xf8\x00\x00\x00\x00\x00\x00"
end
end
platform_is "powerpc64" do
it "encodes NaN" do
[nan_value].pack(pack_format).should == "\x7f\xf8\x00\x00\x00\x00\x00\x00"
end
it "encodes NaN" do
nans = ["\xff\xf8\x00\x00\x00\x00\x00\x00", "\x7f\xf8\x00\x00\x00\x00\x00\x00"]
nans.should include([nan_value].pack(pack_format))
end
it "encodes a positive Float outside the range of a single precision float" do

View file

@ -4,7 +4,7 @@ require_relative 'fixtures/classes'
describe "Array#product" do
it "returns converted arguments using :to_ary" do
lambda{ [1].product(2..3) }.should raise_error(TypeError)
ar = ArraySpecs::ArrayConvertable.new(2,3)
ar = ArraySpecs::ArrayConvertible.new(2,3)
[1].product(ar).should == [[1,2],[1,3]]
ar.called.should == :to_ary
end

View file

@ -28,7 +28,7 @@ describe "Array#rassoc" do
[[1, :foobar], [2, o], [3, mock('foo')]].rassoc(key).should == [2, o]
end
it "does not check the last element in each contained but speficically the second" do
it "does not check the last element in each contained but specifically the second" do
key = 'foobar'
o = mock('foobar')
def o.==(other); other == 'foobar'; end

View file

@ -68,7 +68,7 @@ describe "Array#repeated_combination" do
[].repeated_combination(0).size.should == 1
end
it "returns the binomial coeficient between combination_size and array size + combination_size -1" do
it "returns the binomial coefficient between combination_size and array size + combination_size -1" do
@array.repeated_combination(5).size.should == 21
@array.repeated_combination(4).size.should == 15
@array.repeated_combination(3).size.should == 10

View file

@ -18,7 +18,7 @@ ruby_version_is '2.4' do
[].sum.should == 0
end
it "adds init value to the sum of elemens" do
it "adds init value to the sum of elements" do
[1, 2, 3].sum(10).should == 16
end

View file

@ -42,7 +42,7 @@ describe "Array#zip" do
[1, 2].zip(10.upto(Float::INFINITY)).should == [[1, 10], [2, 11]]
end
it "fills nil when the given enumereator is shorter than self" do
it "fills nil when the given enumerator is shorter than self" do
obj = Object.new
def obj.each
yield 10