From 60f4865de4b75d651efe1a37e2fad374509df0cc Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 10 Jul 2023 14:45:42 +0900 Subject: [PATCH] Remove old guards for before 3.0 - logger 1.4.2 since ruby 2.7.0 - matrix 0.3.1 since ruby 3.0.0 - stringio 3.0.0 since ruby 3.0.0 --- library/logger/device/close_spec.rb | 15 +++------------ library/logger/device/write_spec.rb | 15 +++------------ library/matrix/unitary_spec.rb | 6 ++---- library/openssl/config/freeze_spec.rb | 22 ---------------------- library/stringio/initialize_spec.rb | 13 ++++--------- 5 files changed, 12 insertions(+), 59 deletions(-) delete mode 100644 library/openssl/config/freeze_spec.rb diff --git a/library/logger/device/close_spec.rb b/library/logger/device/close_spec.rb index 7c5e118d56..1db5d582a7 100644 --- a/library/logger/device/close_spec.rb +++ b/library/logger/device/close_spec.rb @@ -15,17 +15,8 @@ rm_r @file_path end - version_is Logger::VERSION, ""..."1.4.0" do - it "closes the LogDevice's stream" do - @device.close - -> { @device.write("Test") }.should complain(/\Alog writing failed\./) - end - end - - version_is Logger::VERSION, "1.4.0" do - it "closes the LogDevice's stream" do - @device.close - -> { @device.write("Test") }.should complain(/\Alog shifting failed\./) - end + it "closes the LogDevice's stream" do + @device.close + -> { @device.write("Test") }.should complain(/\Alog shifting failed\./) end end diff --git a/library/logger/device/write_spec.rb b/library/logger/device/write_spec.rb index cd2d7e27a9..87ecf2ad6a 100644 --- a/library/logger/device/write_spec.rb +++ b/library/logger/device/write_spec.rb @@ -35,17 +35,8 @@ rm_r path end - version_is Logger::VERSION, ""..."1.4.0" do - it "fails if the device is already closed" do - @device.close - -> { @device.write "foo" }.should complain(/\Alog writing failed\./) - end - end - - version_is Logger::VERSION, "1.4.0" do - it "fails if the device is already closed" do - @device.close - -> { @device.write "foo" }.should complain(/\Alog shifting failed\./) - end + it "fails if the device is already closed" do + @device.close + -> { @device.write "foo" }.should complain(/\Alog shifting failed\./) end end diff --git a/library/matrix/unitary_spec.rb b/library/matrix/unitary_spec.rb index b579cb244d..04e6df8be0 100644 --- a/library/matrix/unitary_spec.rb +++ b/library/matrix/unitary_spec.rb @@ -14,10 +14,8 @@ Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].should.unitary? end - version_is((Matrix::const_defined?(:VERSION) ? Matrix::VERSION : "0.1.0"), "0.3.0") do - it "returns true for unitary matrices with a Complex and a negative #imag" do - Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].should.unitary? - end + it "returns true for unitary matrices with a Complex and a negative #imag" do + Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].should.unitary? end it "raises an error for rectangular matrices" do diff --git a/library/openssl/config/freeze_spec.rb b/library/openssl/config/freeze_spec.rb deleted file mode 100644 index c814341b86..0000000000 --- a/library/openssl/config/freeze_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_relative '../../../spec_helper' -require_relative '../shared/constants' - -require 'openssl' - -version_is(OpenSSL::VERSION, ""..."2.2") do - describe "OpenSSL::Config#freeze" do - it "needs to be reviewed for completeness" - - it "freezes" do - c = OpenSSL::Config.new - -> { - c['foo'] = [ ['key', 'value'] ] - }.should_not raise_error - c.freeze - c.frozen?.should be_true - -> { - c['foo'] = [ ['key', 'value'] ] - }.should raise_error(TypeError) - end - end -end diff --git a/library/stringio/initialize_spec.rb b/library/stringio/initialize_spec.rb index c597e328d3..158c08488b 100644 --- a/library/stringio/initialize_spec.rb +++ b/library/stringio/initialize_spec.rb @@ -294,14 +294,9 @@ io.string.encoding.should == Encoding::EUC_JP end - guard_not -> { # [Bug #16497] - stringio_version = StringIO.const_defined?(:VERSION) ? StringIO::VERSION : "0.0.2" - version_is(stringio_version, "0.0.3"..."0.1.1") - } do - it "the #external_encoding to the encoding of the String when passed a String" do - s = ''.force_encoding(Encoding::EUC_JP) - io = StringIO.new(s) - io.external_encoding.should == Encoding::EUC_JP - end + it "the #external_encoding to the encoding of the String when passed a String" do + s = ''.force_encoding(Encoding::EUC_JP) + io = StringIO.new(s) + io.external_encoding.should == Encoding::EUC_JP end end