summaryrefslogtreecommitdiff
path: root/spec/ruby/library
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-08 19:43:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-01 15:36:20 +0900
commit826f44834fe11f3f9c52343443a15b6c83466889 (patch)
treef2c2abed62db1c750515cd8b0fbac6442b6d4200 /spec/ruby/library
parent3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (diff)
Drop support for ruby 2.4 from ruby/spec
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2892
Diffstat (limited to 'spec/ruby/library')
-rw-r--r--spec/ruby/library/bigdecimal/constants_spec.rb6
-rw-r--r--spec/ruby/library/bigdecimal/shared/clone.rb17
-rw-r--r--spec/ruby/library/cgi/cookie/to_s_spec.rb13
-rw-r--r--spec/ruby/library/cgi/escape_spec.rb12
-rw-r--r--spec/ruby/library/delegate/delegator/eql_spec.rb55
-rw-r--r--spec/ruby/library/erb/util/shared/url_encode.rb12
-rw-r--r--spec/ruby/library/getoptlong/shared/get.rb10
-rw-r--r--spec/ruby/library/mathn/bignum/exponent_spec.rb21
-rw-r--r--spec/ruby/library/mathn/complex/Complex_spec.rb14
-rw-r--r--spec/ruby/library/mathn/fixnum/exponent_spec.rb17
-rw-r--r--spec/ruby/library/mathn/float/exponent_spec.rb17
-rw-r--r--spec/ruby/library/mathn/integer/from_prime_division_spec.rb11
-rw-r--r--spec/ruby/library/mathn/integer/prime_division_spec.rb21
-rw-r--r--spec/ruby/library/mathn/math/fixtures/classes.rb3
-rw-r--r--spec/ruby/library/mathn/math/rsqrt_spec.rb17
-rw-r--r--spec/ruby/library/mathn/math/shared/rsqrt.rb21
-rw-r--r--spec/ruby/library/mathn/math/shared/sqrt.rb25
-rw-r--r--spec/ruby/library/mathn/math/sqrt_spec.rb17
-rw-r--r--spec/ruby/library/mathn/mathn_spec.rb13
-rw-r--r--spec/ruby/library/mathn/rational/Rational_spec.rb14
-rw-r--r--spec/ruby/library/mathn/rational/inspect_spec.rb15
-rw-r--r--spec/ruby/library/net/ftp/initialize_spec.rb4
-rw-r--r--spec/ruby/library/rbconfig/sizeof/limits_spec.rb58
-rw-r--r--spec/ruby/library/rbconfig/unicode_version_spec.rb6
-rw-r--r--spec/ruby/library/set/case_compare_spec.rb12
-rw-r--r--spec/ruby/library/set/case_equality_spec.rb6
-rw-r--r--spec/ruby/library/set/sortedset/case_equality_spec.rb6
-rw-r--r--spec/ruby/library/set/to_s_spec.rb12
-rw-r--r--spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb64
-rw-r--r--spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb62
-rw-r--r--spec/ruby/library/socket/udpsocket/inspect_spec.rb14
-rw-r--r--spec/ruby/library/yaml/load_documents_spec.rb10
-rw-r--r--spec/ruby/library/yaml/tagurize_spec.rb11
33 files changed, 144 insertions, 472 deletions
diff --git a/spec/ruby/library/bigdecimal/constants_spec.rb b/spec/ruby/library/bigdecimal/constants_spec.rb
index 1eb24d85cb..8d879c036a 100644
--- a/spec/ruby/library/bigdecimal/constants_spec.rb
+++ b/spec/ruby/library/bigdecimal/constants_spec.rb
@@ -2,10 +2,8 @@ require_relative '../../spec_helper'
require 'bigdecimal'
describe "BigDecimal constants" do
- ruby_version_is "2.5" do
- it "defines a VERSION value" do
- BigDecimal.const_defined?(:VERSION).should be_true
- end
+ it "defines a VERSION value" do
+ BigDecimal.const_defined?(:VERSION).should be_true
end
it "has a BASE value" do
diff --git a/spec/ruby/library/bigdecimal/shared/clone.rb b/spec/ruby/library/bigdecimal/shared/clone.rb
index e58df3a94b..935ef76e7e 100644
--- a/spec/ruby/library/bigdecimal/shared/clone.rb
+++ b/spec/ruby/library/bigdecimal/shared/clone.rb
@@ -5,20 +5,9 @@ describe :bigdecimal_clone, shared: true do
@obj = BigDecimal("1.2345")
end
- ruby_version_is "" ... "2.5" do
- it "copies the BigDecimal's value to a newly allocated object" do
- copy = @obj.public_send(@method)
+ it "returns self" do
+ copy = @obj.public_send(@method)
- copy.should_not equal(@obj)
- copy.should == @obj
- end
- end
-
- ruby_version_is "2.5" do
- it "returns self" do
- copy = @obj.public_send(@method)
-
- copy.should equal(@obj)
- end
+ copy.should equal(@obj)
end
end
diff --git a/spec/ruby/library/cgi/cookie/to_s_spec.rb b/spec/ruby/library/cgi/cookie/to_s_spec.rb
index 978c2d33eb..da15e6ed2a 100644
--- a/spec/ruby/library/cgi/cookie/to_s_spec.rb
+++ b/spec/ruby/library/cgi/cookie/to_s_spec.rb
@@ -27,16 +27,7 @@ describe "CGI::Cookie#to_s" do
cookie.to_s.should == "test-cookie=+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D; path="
end
- ruby_version_is ""..."2.5" do
- it "escapes tilde" do
- cookie = CGI::Cookie.new("test-cookie", "~").to_s.should == "test-cookie=%7E; path="
- end
+ it "does not escape tilde" do
+ cookie = CGI::Cookie.new("test-cookie", "~").to_s.should == "test-cookie=~; path="
end
-
- ruby_version_is "2.5" do
- it "does not escape tilde" do
- cookie = CGI::Cookie.new("test-cookie", "~").to_s.should == "test-cookie=~; path="
- end
- end
-
end
diff --git a/spec/ruby/library/cgi/escape_spec.rb b/spec/ruby/library/cgi/escape_spec.rb
index 351bfe1070..2f1913970e 100644
--- a/spec/ruby/library/cgi/escape_spec.rb
+++ b/spec/ruby/library/cgi/escape_spec.rb
@@ -12,15 +12,7 @@ describe "CGI.escape" do
CGI.escape(input).should == expected
end
- ruby_version_is ""..."2.5" do
- it "escapes tilde" do
- CGI.escape("~").should == "%7E"
- end
- end
-
- ruby_version_is "2.5" do
- it "does not escape tilde" do
- CGI.escape("~").should == "~"
- end
+ it "does not escape tilde" do
+ CGI.escape("~").should == "~"
end
end
diff --git a/spec/ruby/library/delegate/delegator/eql_spec.rb b/spec/ruby/library/delegate/delegator/eql_spec.rb
index 3170d5727a..34f56f44c9 100644
--- a/spec/ruby/library/delegate/delegator/eql_spec.rb
+++ b/spec/ruby/library/delegate/delegator/eql_spec.rb
@@ -2,45 +2,34 @@ require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
describe "Delegator#eql?" do
- ruby_version_is ""..."2.5" do
- it "is delegated" do
- base = mock('base')
- delegator = DelegateSpecs::Delegator.new(base)
- base.should_receive(:eql?).with(42).and_return(:foo)
- delegator.eql?(42).should == :foo
- end
- end
-
- ruby_version_is "2.5" do
- it "returns true when compared with same delegator" do
- base = mock('base')
- delegator = DelegateSpecs::Delegator.new(base)
+ it "returns true when compared with same delegator" do
+ base = mock('base')
+ delegator = DelegateSpecs::Delegator.new(base)
- delegator.eql?(delegator).should be_true
- end
+ delegator.eql?(delegator).should be_true
+ end
- it "returns true when compared with the inner object" do
- base = mock('base')
- delegator = DelegateSpecs::Delegator.new(base)
+ it "returns true when compared with the inner object" do
+ base = mock('base')
+ delegator = DelegateSpecs::Delegator.new(base)
- delegator.eql?(base).should be_true
- end
+ delegator.eql?(base).should be_true
+ end
- it "returns false when compared with the delegator with other object" do
- base = mock('base')
- other = mock('other')
- delegator0 = DelegateSpecs::Delegator.new(base)
- delegator1 = DelegateSpecs::Delegator.new(other)
+ it "returns false when compared with the delegator with other object" do
+ base = mock('base')
+ other = mock('other')
+ delegator0 = DelegateSpecs::Delegator.new(base)
+ delegator1 = DelegateSpecs::Delegator.new(other)
- delegator0.eql?(delegator1).should be_false
- end
+ delegator0.eql?(delegator1).should be_false
+ end
- it "returns false when compared with the other object" do
- base = mock('base')
- other = mock('other')
- delegator = DelegateSpecs::Delegator.new(base)
+ it "returns false when compared with the other object" do
+ base = mock('base')
+ other = mock('other')
+ delegator = DelegateSpecs::Delegator.new(base)
- delegator.eql?(other).should be_false
- end
+ delegator.eql?(other).should be_false
end
end
diff --git a/spec/ruby/library/erb/util/shared/url_encode.rb b/spec/ruby/library/erb/util/shared/url_encode.rb
index 5ac6215523..a2d648fd31 100644
--- a/spec/ruby/library/erb/util/shared/url_encode.rb
+++ b/spec/ruby/library/erb/util/shared/url_encode.rb
@@ -6,16 +6,8 @@ describe :erb_util_url_encode, shared: true do
ERB::Util.__send__(@method, input).should == expected
end
- ruby_version_is ""..."2.5" do
- it "escapes tilde" do
- ERB::Util.__send__(@method, "~").should == "%7E"
- end
- end
-
- ruby_version_is "2.5" do
- it "does not escape tilde" do
- ERB::Util.__send__(@method, "~").should == "~"
- end
+ it "does not escape tilde" do
+ ERB::Util.__send__(@method, "~").should == "~"
end
it "encode unicode string" do
diff --git a/spec/ruby/library/getoptlong/shared/get.rb b/spec/ruby/library/getoptlong/shared/get.rb
index 772a7f6773..f44cf583d2 100644
--- a/spec/ruby/library/getoptlong/shared/get.rb
+++ b/spec/ruby/library/getoptlong/shared/get.rb
@@ -53,12 +53,10 @@ describe :getoptlong_get, shared: true do
end
end
- ruby_version_is "2.5" do
- # https://bugs.ruby-lang.org/issues/13858
- it "returns multiline argument" do
- argv [ "--size=\n10k\n" ] do
- @opts.send(@method).should == [ "--size", "\n10k\n" ]
- end
+ # https://bugs.ruby-lang.org/issues/13858
+ it "returns multiline argument" do
+ argv [ "--size=\n10k\n" ] do
+ @opts.send(@method).should == [ "--size", "\n10k\n" ]
end
end
end
diff --git a/spec/ruby/library/mathn/bignum/exponent_spec.rb b/spec/ruby/library/mathn/bignum/exponent_spec.rb
deleted file mode 100644
index ddd19ffdb4..0000000000
--- a/spec/ruby/library/mathn/bignum/exponent_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Bignum#**" do
- before :each do
- @bignum = bignum_value(47)
- end
-
- it "returns self raised to other (positive) power" do
- (@bignum ** 4).should == 7237005577332262361485077344629993318496048279512298547155833600056910050625
- (@bignum ** 1.2).should be_close(57262152889751597425762.57804, TOLERANCE)
- end
-
- it "returns a complex number when negative and raised to a fractional power" do
- ((-@bignum) ** (1/3)).should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
- ((-@bignum) ** (1.0/3)).should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/complex/Complex_spec.rb b/spec/ruby/library/mathn/complex/Complex_spec.rb
deleted file mode 100644
index 105902ed5d..0000000000
--- a/spec/ruby/library/mathn/complex/Complex_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Kernel#Complex" do
- it "returns an Integer if imaginary part is 0" do
- Complex(42,0).should == 42
- Complex(42,0).should be_kind_of(Fixnum)
- Complex(bignum_value,0).should == bignum_value
- Complex(bignum_value,0).should be_kind_of(Bignum)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/fixnum/exponent_spec.rb b/spec/ruby/library/mathn/fixnum/exponent_spec.rb
deleted file mode 100644
index 160bf7f115..0000000000
--- a/spec/ruby/library/mathn/fixnum/exponent_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Fixnum#**" do
- it "returns self raised to other (positive) power" do
- (2 ** 4).should == 16
- (2 ** 1.2).should be_close(2.2973967, TOLERANCE)
- end
-
- it "returns a complex number when negative and raised to a fractional power" do
- ((-8) ** (1/3)).should be_close(Complex(1, 1.73205), TOLERANCE)
- ((-8) ** (1.0/3)).should be_close(Complex(1, 1.73205), TOLERANCE)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/float/exponent_spec.rb b/spec/ruby/library/mathn/float/exponent_spec.rb
deleted file mode 100644
index 312119db00..0000000000
--- a/spec/ruby/library/mathn/float/exponent_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Float#**" do
- it "returns self raised to other (positive) power" do
- (2.0 ** 4).should == 16.0
- (2.0 ** 1.2).should be_close(2.2973967, TOLERANCE)
- end
-
- it "returns a complex number when negative and raised to a fractional power" do
- ((-8.0) ** (1/3)).should be_close(Complex(1, 1.73205), TOLERANCE)
- ((-8.0) ** (1.0/3)).should be_close(Complex(1, 1.73205), TOLERANCE)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/integer/from_prime_division_spec.rb b/spec/ruby/library/mathn/integer/from_prime_division_spec.rb
deleted file mode 100644
index df2db6d8c1..0000000000
--- a/spec/ruby/library/mathn/integer/from_prime_division_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Integer.from_prime_division" do
- it "reverses a prime factorization of an integer" do
- Integer.from_prime_division([[2, 1], [3, 2], [7, 1]]).should == 126
- end
- end
-end
diff --git a/spec/ruby/library/mathn/integer/prime_division_spec.rb b/spec/ruby/library/mathn/integer/prime_division_spec.rb
deleted file mode 100644
index fb4a1c3fea..0000000000
--- a/spec/ruby/library/mathn/integer/prime_division_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Integer#prime_division" do
- it "performs a prime factorization of a positive integer" do
- 100.prime_division.should == [[2, 2], [5, 2]]
- end
-
- # Proper handling of negative integers has been added to MRI trunk
- # in revision 24091. Prior to that, all versions of MRI returned nonsense.
- it "performs a prime factorization of a negative integer" do
- -26.prime_division.should == [[-1, 1], [2, 1], [13, 1]]
- end
-
- it "raises a ZeroDivisionError when is called on zero" do
- -> { 0.prime_division }.should raise_error(ZeroDivisionError)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/math/fixtures/classes.rb b/spec/ruby/library/mathn/math/fixtures/classes.rb
deleted file mode 100644
index 024732fa7a..0000000000
--- a/spec/ruby/library/mathn/math/fixtures/classes.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class IncludesMath
- include Math
-end
diff --git a/spec/ruby/library/mathn/math/rsqrt_spec.rb b/spec/ruby/library/mathn/math/rsqrt_spec.rb
deleted file mode 100644
index 6cb7595afe..0000000000
--- a/spec/ruby/library/mathn/math/rsqrt_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require_relative 'shared/rsqrt'
-
- describe "Math#rsqrt" do
- it_behaves_like :mathn_math_rsqrt, :_, IncludesMath.new
-
- it "is a private instance method" do
- IncludesMath.should have_private_instance_method(:rsqrt)
- end
- end
-
- describe "Math.rsqrt" do
- it_behaves_like :mathn_math_rsqrt, :_, Math
- end
-end
diff --git a/spec/ruby/library/mathn/math/shared/rsqrt.rb b/spec/ruby/library/mathn/math/shared/rsqrt.rb
deleted file mode 100644
index ea3d1b0cfc..0000000000
--- a/spec/ruby/library/mathn/math/shared/rsqrt.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'mathn'
-require_relative '../fixtures/classes'
-
-describe :mathn_math_rsqrt, shared: true do
- it "returns the square root for Rational numbers" do
- @object.send(:rsqrt, Rational(9, 25)).should == Rational(3, 5)
- @object.send(:rsqrt, 16/64).should == Rational(1, 2)
- end
-
- it "returns the square root for positive numbers" do
- @object.send(:rsqrt, 1).should == 1
- @object.send(:rsqrt, 4.0).should == 2.0
- @object.send(:rsqrt, 12.34).should == Math.sqrt!(12.34)
- end
-
- it "raises an Math::DomainError if the argument is a negative number" do
- -> { @object.send(:rsqrt, -1) }.should raise_error(Math::DomainError)
- -> { @object.send(:rsqrt, -4.0) }.should raise_error(Math::DomainError)
- -> { @object.send(:rsqrt, -16/64) }.should raise_error(Math::DomainError)
- end
-end
diff --git a/spec/ruby/library/mathn/math/shared/sqrt.rb b/spec/ruby/library/mathn/math/shared/sqrt.rb
deleted file mode 100644
index 5e6dae1d4f..0000000000
--- a/spec/ruby/library/mathn/math/shared/sqrt.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'mathn'
-require_relative '../fixtures/classes'
-
-describe :mathn_math_sqrt, shared: true do
- it "returns the square root for Rational numbers" do
- @object.send(:sqrt, Rational(9, 25)).should == Rational(3, 5)
- @object.send(:sqrt, 16/64).should == Rational(1, 2)
- end
-
- it "returns the square root for Complex numbers" do
- @object.send(:sqrt, Complex(1, 0)).should == 1
- end
-
- it "returns the square root for positive numbers" do
- @object.send(:sqrt, 1).should == 1
- @object.send(:sqrt, 4.0).should == 2.0
- @object.send(:sqrt, 12.34).should == Math.sqrt!(12.34)
- end
-
- it "returns the square root for negative numbers" do
- @object.send(:sqrt, -9).should == Complex(0, 3)
- @object.send(:sqrt, -5.29).should == Complex(0, 2.3)
- @object.send(:sqrt, -16/64).should == Complex(0, 1/2)
- end
-end
diff --git a/spec/ruby/library/mathn/math/sqrt_spec.rb b/spec/ruby/library/mathn/math/sqrt_spec.rb
deleted file mode 100644
index 49cfe3600e..0000000000
--- a/spec/ruby/library/mathn/math/sqrt_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require_relative 'shared/sqrt'
-
- describe "Math#rsqrt" do
- it_behaves_like :mathn_math_sqrt, :_, IncludesMath.new
-
- it "is a private instance method" do
- IncludesMath.should have_private_instance_method(:sqrt)
- end
- end
-
- describe "Math.rsqrt" do
- it_behaves_like :mathn_math_sqrt, :_, Math
- end
-end
diff --git a/spec/ruby/library/mathn/mathn_spec.rb b/spec/ruby/library/mathn/mathn_spec.rb
deleted file mode 100644
index 129c8f3288..0000000000
--- a/spec/ruby/library/mathn/mathn_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require_relative '../../spec_helper'
-
-describe "mathn" do
- ruby_version_is "2.5" do
- it "is no longer part of the standard library" do
- -> {
- require "mathn"
- }.should raise_error(LoadError) { |e|
- e.path.should == 'mathn'
- }
- end
- end
-end
diff --git a/spec/ruby/library/mathn/rational/Rational_spec.rb b/spec/ruby/library/mathn/rational/Rational_spec.rb
deleted file mode 100644
index 9a34c99751..0000000000
--- a/spec/ruby/library/mathn/rational/Rational_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Kernel#Rational" do
- it "returns an Integer if denominator divides numerator evenly" do
- Rational(42,6).should == 7
- Rational(42,6).should be_kind_of(Fixnum)
- Rational(bignum_value,1).should == bignum_value
- Rational(bignum_value,1).should be_kind_of(Bignum)
- end
- end
-end
diff --git a/spec/ruby/library/mathn/rational/inspect_spec.rb b/spec/ruby/library/mathn/rational/inspect_spec.rb
deleted file mode 100644
index cbf67ec0f3..0000000000
--- a/spec/ruby/library/mathn/rational/inspect_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require_relative '../../../spec_helper'
-
-ruby_version_is ''...'2.5' do
- require 'mathn'
-
- describe "Rational#inspect" do
- it "returns a string representation of self" do
- Rational(3, 4).inspect.should == "(3/4)"
- Rational(-5, 8).inspect.should == "(-5/8)"
- Rational(-1, -2).inspect.should == "(1/2)"
- Rational(0, 2).inspect.should == "0"
- Rational(bignum_value, 1).inspect.should == "#{bignum_value}"
- end
- end
-end
diff --git a/spec/ruby/library/net/ftp/initialize_spec.rb b/spec/ruby/library/net/ftp/initialize_spec.rb
index 507320e494..a2f64ddb1b 100644
--- a/spec/ruby/library/net/ftp/initialize_spec.rb
+++ b/spec/ruby/library/net/ftp/initialize_spec.rb
@@ -6,9 +6,7 @@ describe "Net::FTP#initialize" do
@ftp = Net::FTP.allocate
@ftp.stub!(:connect)
@port_args = []
- ruby_version_is "2.5" do
- @port_args << 21
- end
+ @port_args << 21
end
it "is private" do
diff --git a/spec/ruby/library/rbconfig/sizeof/limits_spec.rb b/spec/ruby/library/rbconfig/sizeof/limits_spec.rb
index a026135eee..776099da27 100644
--- a/spec/ruby/library/rbconfig/sizeof/limits_spec.rb
+++ b/spec/ruby/library/rbconfig/sizeof/limits_spec.rb
@@ -1,42 +1,40 @@
require_relative '../../../spec_helper'
require 'rbconfig/sizeof'
-ruby_version_is "2.5" do
- describe "RbConfig::LIMITS" do
- it "is a Hash" do
- RbConfig::LIMITS.should be_kind_of(Hash)
- end
+describe "RbConfig::LIMITS" do
+ it "is a Hash" do
+ RbConfig::LIMITS.should be_kind_of(Hash)
+ end
- it "has string keys and numeric values" do
- RbConfig::LIMITS.each do |key, value|
- key.should be_kind_of String
- value.should be_kind_of Numeric
- end
+ it "has string keys and numeric values" do
+ RbConfig::LIMITS.each do |key, value|
+ key.should be_kind_of String
+ value.should be_kind_of Numeric
end
+ end
- it "contains FIXNUM_MIN and FIXNUM_MAX" do
- RbConfig::LIMITS["FIXNUM_MIN"].should < 0
- RbConfig::LIMITS["FIXNUM_MAX"].should > 0
- end
+ it "contains FIXNUM_MIN and FIXNUM_MAX" do
+ RbConfig::LIMITS["FIXNUM_MIN"].should < 0
+ RbConfig::LIMITS["FIXNUM_MAX"].should > 0
+ end
- it "contains CHAR_MIN and CHAR_MAX" do
- RbConfig::LIMITS["CHAR_MIN"].should <= 0
- RbConfig::LIMITS["CHAR_MAX"].should > 0
- end
+ it "contains CHAR_MIN and CHAR_MAX" do
+ RbConfig::LIMITS["CHAR_MIN"].should <= 0
+ RbConfig::LIMITS["CHAR_MAX"].should > 0
+ end
- it "contains SHRT_MIN and SHRT_MAX" do
- RbConfig::LIMITS["SHRT_MIN"].should == -32768
- RbConfig::LIMITS["SHRT_MAX"].should == 32767
- end
+ it "contains SHRT_MIN and SHRT_MAX" do
+ RbConfig::LIMITS["SHRT_MIN"].should == -32768
+ RbConfig::LIMITS["SHRT_MAX"].should == 32767
+ end
- it "contains INT_MIN and INT_MAX" do
- RbConfig::LIMITS["INT_MIN"].should < 0
- RbConfig::LIMITS["INT_MAX"].should > 0
- end
+ it "contains INT_MIN and INT_MAX" do
+ RbConfig::LIMITS["INT_MIN"].should < 0
+ RbConfig::LIMITS["INT_MAX"].should > 0
+ end
- it "contains LONG_MIN and LONG_MAX" do
- RbConfig::LIMITS["LONG_MIN"].should < 0
- RbConfig::LIMITS["LONG_MAX"].should > 0
- end
+ it "contains LONG_MIN and LONG_MAX" do
+ RbConfig::LIMITS["LONG_MIN"].should < 0
+ RbConfig::LIMITS["LONG_MAX"].should > 0
end
end
diff --git a/spec/ruby/library/rbconfig/unicode_version_spec.rb b/spec/ruby/library/rbconfig/unicode_version_spec.rb
index 44216700c8..65bd70c242 100644
--- a/spec/ruby/library/rbconfig/unicode_version_spec.rb
+++ b/spec/ruby/library/rbconfig/unicode_version_spec.rb
@@ -2,12 +2,6 @@ require_relative '../../spec_helper'
require 'rbconfig'
describe "RbConfig::CONFIG['UNICODE_VERSION']" do
- ruby_version_is ""..."2.5" do
- it "is 9.0.0 for Ruby 2.4" do
- RbConfig::CONFIG['UNICODE_VERSION'].should == "9.0.0"
- end
- end
-
ruby_version_is "2.5"..."2.6" do
it "is 10.0.0 for Ruby 2.5" do
RbConfig::CONFIG['UNICODE_VERSION'].should == "10.0.0"
diff --git a/spec/ruby/library/set/case_compare_spec.rb b/spec/ruby/library/set/case_compare_spec.rb
index 193006dbda..70d392a27d 100644
--- a/spec/ruby/library/set/case_compare_spec.rb
+++ b/spec/ruby/library/set/case_compare_spec.rb
@@ -2,13 +2,11 @@ require_relative '../../spec_helper'
require_relative 'shared/include'
require 'set'
-ruby_version_is "2.5" do
- describe "Set#===" do
- it_behaves_like :set_include, :===
+describe "Set#===" do
+ it_behaves_like :set_include, :===
- it "is an alias for include?" do
- set = Set.new
- set.method(:===).should == set.method(:include?)
- end
+ it "is an alias for include?" do
+ set = Set.new
+ set.method(:===).should == set.method(:include?)
end
end
diff --git a/spec/ruby/library/set/case_equality_spec.rb b/spec/ruby/library/set/case_equality_spec.rb
index 875630612e..10cbfd380a 100644
--- a/spec/ruby/library/set/case_equality_spec.rb
+++ b/spec/ruby/library/set/case_equality_spec.rb
@@ -2,8 +2,6 @@ require_relative '../../spec_helper'
require_relative 'shared/include'
require 'set'
-ruby_version_is "2.5" do
- describe "Set#===" do
- it_behaves_like :set_include, :===
- end
+describe "Set#===" do
+ it_behaves_like :set_include, :===
end
diff --git a/spec/ruby/library/set/sortedset/case_equality_spec.rb b/spec/ruby/library/set/sortedset/case_equality_spec.rb
index 5627917677..48e3735c8e 100644
--- a/spec/ruby/library/set/sortedset/case_equality_spec.rb
+++ b/spec/ruby/library/set/sortedset/case_equality_spec.rb
@@ -2,8 +2,6 @@ require_relative '../../../spec_helper'
require_relative 'shared/include'
require 'set'
-ruby_version_is "2.5" do
- describe "SortedSet#===" do
- it_behaves_like :sorted_set_include, :===
- end
+describe "SortedSet#===" do
+ it_behaves_like :sorted_set_include, :===
end
diff --git a/spec/ruby/library/set/to_s_spec.rb b/spec/ruby/library/set/to_s_spec.rb
index ca2806d669..7b9f7b6603 100644
--- a/spec/ruby/library/set/to_s_spec.rb
+++ b/spec/ruby/library/set/to_s_spec.rb
@@ -1,13 +1,11 @@
require_relative 'shared/inspect'
require 'set'
-ruby_version_is "2.5" do
- describe "Set#to_s" do
- it_behaves_like :set_inspect, :to_s
+describe "Set#to_s" do
+ it_behaves_like :set_inspect, :to_s
- it "is an alias of inspect" do
- set = Set.new
- set.method(:to_s).should == set.method(:inspect)
- end
+ it "is an alias of inspect" do
+ set = Set.new
+ set.method(:to_s).should == set.method(:inspect)
end
end
diff --git a/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb b/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb
index 1823f3d75d..4986fffbc5 100644
--- a/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb
+++ b/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb
@@ -1,45 +1,43 @@
require_relative '../spec_helper'
require_relative '../fixtures/classes'
-ruby_version_is "2.5" do
- describe "BasicSocket#read_nonblock" do
- SocketSpecs.each_ip_protocol do |family, ip_address|
- before :each do
- @r = Socket.new(family, :DGRAM)
- @w = Socket.new(family, :DGRAM)
+describe "BasicSocket#read_nonblock" do
+ SocketSpecs.each_ip_protocol do |family, ip_address|
+ before :each do
+ @r = Socket.new(family, :DGRAM)
+ @w = Socket.new(family, :DGRAM)
- @r.bind(Socket.pack_sockaddr_in(0, ip_address))
- @w.send("aaa", 0, @r.getsockname)
- end
+ @r.bind(Socket.pack_sockaddr_in(0, ip_address))
+ @w.send("aaa", 0, @r.getsockname)
+ end
- after :each do
- @r.close unless @r.closed?
- @w.close unless @w.closed?
- end
+ after :each do
+ @r.close unless @r.closed?
+ @w.close unless @w.closed?
+ end
- it "receives data after it's ready" do
- IO.select([@r], nil, nil, 2)
- @r.recv_nonblock(5).should == "aaa"
- end
+ it "receives data after it's ready" do
+ IO.select([@r], nil, nil, 2)
+ @r.recv_nonblock(5).should == "aaa"
+ end
- platform_is :linux do
- it 'does not set the IO in nonblock mode' do
- require 'io/nonblock'
- @r.nonblock?.should == false
- IO.select([@r], nil, nil, 2)
- @r.read_nonblock(3).should == "aaa"
- @r.nonblock?.should == false
- end
+ platform_is :linux do
+ it 'does not set the IO in nonblock mode' do
+ require 'io/nonblock'
+ @r.nonblock?.should == false
+ IO.select([@r], nil, nil, 2)
+ @r.read_nonblock(3).should == "aaa"
+ @r.nonblock?.should == false
end
+ end
- platform_is_not :linux, :windows do
- it 'sets the IO in nonblock mode' do
- require 'io/nonblock'
- @r.nonblock?.should == false
- IO.select([@r], nil, nil, 2)
- @r.read_nonblock(3).should == "aaa"
- @r.nonblock?.should == true
- end
+ platform_is_not :linux, :windows do
+ it 'sets the IO in nonblock mode' do
+ require 'io/nonblock'
+ @r.nonblock?.should == false
+ IO.select([@r], nil, nil, 2)
+ @r.read_nonblock(3).should == "aaa"
+ @r.nonblock?.should == true
end
end
end
diff --git a/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb b/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb
index f2e7366eb1..95ec08a6c7 100644
--- a/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb
+++ b/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb
@@ -1,44 +1,42 @@
require_relative '../spec_helper'
require_relative '../fixtures/classes'
-ruby_version_is "2.5" do
- describe "BasicSocket#write_nonblock" do
- SocketSpecs.each_ip_protocol do |family, ip_address|
- before :each do
- @r = Socket.new(family, :DGRAM)
- @w = Socket.new(family, :DGRAM)
+describe "BasicSocket#write_nonblock" do
+ SocketSpecs.each_ip_protocol do |family, ip_address|
+ before :each do
+ @r = Socket.new(family, :DGRAM)
+ @w = Socket.new(family, :DGRAM)
- @r.bind(Socket.pack_sockaddr_in(0, ip_address))
- @w.connect(@r.getsockname)
- end
+ @r.bind(Socket.pack_sockaddr_in(0, ip_address))
+ @w.connect(@r.getsockname)
+ end
- after :each do
- @r.close unless @r.closed?
- @w.close unless @w.closed?
- end
+ after :each do
+ @r.close unless @r.closed?
+ @w.close unless @w.closed?
+ end
- it "sends data" do
- @w.write_nonblock("aaa").should == 3
- IO.select([@r], nil, nil, 2)
- @r.recv_nonblock(5).should == "aaa"
- end
+ it "sends data" do
+ @w.write_nonblock("aaa").should == 3
+ IO.select([@r], nil, nil, 2)
+ @r.recv_nonblock(5).should == "aaa"
+ end
- platform_is :linux do
- it 'does not set the IO in nonblock mode' do
- require 'io/nonblock'
- @w.nonblock?.should == false
- @w.write_nonblock("aaa").should == 3
- @w.nonblock?.should == false
- end
+ platform_is :linux do
+ it 'does not set the IO in nonblock mode' do
+ require 'io/nonblock'
+ @w.nonblock?.should == false
+ @w.write_nonblock("aaa").should == 3
+ @w.nonblock?.should == false
end
+ end
- platform_is_not :linux, :windows do
- it 'sets the IO in nonblock mode' do
- require 'io/nonblock'
- @w.nonblock?.should == false
- @w.write_nonblock("aaa").should == 3
- @w.nonblock?.should == true
- end
+ platform_is_not :linux, :windows do
+ it 'sets the IO in nonblock mode' do
+ require 'io/nonblock'
+ @w.nonblock?.should == false
+ @w.write_nonblock("aaa").should == 3
+ @w.nonblock?.should == true
end
end
end
diff --git a/spec/ruby/library/socket/udpsocket/inspect_spec.rb b/spec/ruby/library/socket/udpsocket/inspect_spec.rb
index 201e8b3fc6..e212120b14 100644
--- a/spec/ruby/library/socket/udpsocket/inspect_spec.rb
+++ b/spec/ruby/library/socket/udpsocket/inspect_spec.rb
@@ -10,16 +10,8 @@ describe 'UDPSocket#inspect' do
@socket.close
end
- ruby_version_is ""..."2.5" do
- it 'returns a String with the fd' do
- @socket.inspect.should == "#<UDPSocket:fd #{@socket.fileno}>"
- end
- end
-
- ruby_version_is "2.5" do
- it 'returns a String with the fd, family, address and port' do
- port = @socket.addr[1]
- @socket.inspect.should == "#<UDPSocket:fd #{@socket.fileno}, AF_INET, 127.0.0.1, #{port}>"
- end
+ it 'returns a String with the fd, family, address and port' do
+ port = @socket.addr[1]
+ @socket.inspect.should == "#<UDPSocket:fd #{@socket.fileno}, AF_INET, 127.0.0.1, #{port}>"
end
end
diff --git a/spec/ruby/library/yaml/load_documents_spec.rb b/spec/ruby/library/yaml/load_documents_spec.rb
deleted file mode 100644
index 27edbcaa86..0000000000
--- a/spec/ruby/library/yaml/load_documents_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require_relative '../../spec_helper'
-require_relative 'fixtures/common'
-require_relative 'fixtures/strings'
-require_relative 'shared/each_document'
-
-ruby_version_is ''...'2.5' do
- describe "YAML.load_documents" do
- it_behaves_like :yaml_each_document, :load_documents
- end
-end
diff --git a/spec/ruby/library/yaml/tagurize_spec.rb b/spec/ruby/library/yaml/tagurize_spec.rb
deleted file mode 100644
index cc1b757ce9..0000000000
--- a/spec/ruby/library/yaml/tagurize_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require_relative '../../spec_helper'
-require_relative 'fixtures/common'
-
-ruby_version_is ''...'2.5' do
- describe "YAML.tagurize" do
- it "converts a type_id to a taguri" do
- YAML.tagurize('wtf').should == "tag:yaml.org,2002:wtf"
- YAML.tagurize(1).should == 1
- end
- end
-end