Skip to content

Commit

Permalink
Remove old guards for before 3.0
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
nobu authored and eregon committed Jul 10, 2023
1 parent 4da4175 commit 60f4865
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 59 deletions.
15 changes: 3 additions & 12 deletions library/logger/device/close_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 3 additions & 12 deletions library/logger/device/write_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions library/matrix/unitary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 0 additions & 22 deletions library/openssl/config/freeze_spec.rb

This file was deleted.

13 changes: 4 additions & 9 deletions library/stringio/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 60f4865

Please sign in to comment.