diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-07 16:35:33 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-07 16:35:33 +0000 |
commit | 75334db3c6479ea3cd7462d36ca5464d386f9c72 (patch) | |
tree | c97df2c7aa02f3d0e65524890924f1b294871073 /spec/ruby/core/array | |
parent | 5c7c6763f6cf7b4face107735071c5470e835476 (diff) | |
download | ruby-75334db3c6479ea3cd7462d36ca5464d386f9c72.tar.gz |
Update to ruby/spec@6cf8ebe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/array')
-rw-r--r-- | spec/ruby/core/array/combination_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/fixtures/classes.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/array/last_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/pack/shared/float.rb | 52 | ||||
-rw-r--r-- | spec/ruby/core/array/product_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/rassoc_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/repeated_combination_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/sum_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/array/zip_spec.rb | 2 |
9 files changed, 22 insertions, 50 deletions
diff --git a/spec/ruby/core/array/combination_spec.rb b/spec/ruby/core/array/combination_spec.rb index 94a8e19341..f16d6f98fc 100644 --- a/spec/ruby/core/array/combination_spec.rb +++ b/spec/ruby/core/array/combination_spec.rb @@ -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 diff --git a/spec/ruby/core/array/fixtures/classes.rb b/spec/ruby/core/array/fixtures/classes.rb index 7ca9067328..42071ed0cd 100644 --- a/spec/ruby/core/array/fixtures/classes.rb +++ b/spec/ruby/core/array/fixtures/classes.rb @@ -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", diff --git a/spec/ruby/core/array/last_spec.rb b/spec/ruby/core/array/last_spec.rb index 871f4a2352..9bf8648776 100644 --- a/spec/ruby/core/array/last_spec.rb +++ b/spec/ruby/core/array/last_spec.rb @@ -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] diff --git a/spec/ruby/core/array/pack/shared/float.rb b/spec/ruby/core/array/pack/shared/float.rb index 082de27acd..6fc3b6b359 100644 --- a/spec/ruby/core/array/pack/shared/float.rb +++ b/spec/ruby/core/array/pack/shared/float.rb @@ -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 diff --git a/spec/ruby/core/array/product_spec.rb b/spec/ruby/core/array/product_spec.rb index 9207a9b014..7d810b6196 100644 --- a/spec/ruby/core/array/product_spec.rb +++ b/spec/ruby/core/array/product_spec.rb @@ -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 diff --git a/spec/ruby/core/array/rassoc_spec.rb b/spec/ruby/core/array/rassoc_spec.rb index decdaae098..62fbd40611 100644 --- a/spec/ruby/core/array/rassoc_spec.rb +++ b/spec/ruby/core/array/rassoc_spec.rb @@ -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 diff --git a/spec/ruby/core/array/repeated_combination_spec.rb b/spec/ruby/core/array/repeated_combination_spec.rb index 373b7bb6e5..b62382024a 100644 --- a/spec/ruby/core/array/repeated_combination_spec.rb +++ b/spec/ruby/core/array/repeated_combination_spec.rb @@ -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 diff --git a/spec/ruby/core/array/sum_spec.rb b/spec/ruby/core/array/sum_spec.rb index 71b8b9dc78..7d19c03480 100644 --- a/spec/ruby/core/array/sum_spec.rb +++ b/spec/ruby/core/array/sum_spec.rb @@ -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 diff --git a/spec/ruby/core/array/zip_spec.rb b/spec/ruby/core/array/zip_spec.rb index f0de864ed4..af4013debe 100644 --- a/spec/ruby/core/array/zip_spec.rb +++ b/spec/ruby/core/array/zip_spec.rb @@ -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 |