This commit is contained in:
Benoit Daloze 2022-08-29 18:18:23 +02:00
parent b5358a98e6
commit 1315c5aad9
4 changed files with 8 additions and 7 deletions

View File

@ -3,7 +3,7 @@ describe :dir_chroot_as_root, shared: true do
DirSpecs.create_mock_dirs DirSpecs.create_mock_dirs
@real_root = "../" * (File.dirname(__FILE__).count('/') - 1) @real_root = "../" * (File.dirname(__FILE__).count('/') - 1)
@ref_dir = File.join("/", Dir.new('/').entries.first) @ref_dir = File.join("/", File.basename(Dir["/*"].first))
end end
after :all do after :all do

View File

@ -17,10 +17,9 @@ describe :env_update, shared: true do
ruby_version_is "3.2" do ruby_version_is "3.2" do
it "adds the multiple parameter hashes to ENV, returning ENV" do it "adds the multiple parameter hashes to ENV, returning ENV" do
ENV.send(@method, {"foo" => "0", "bar" => "1"}, {"baz" => "2"}).should equal(ENV) ENV.send(@method, {"foo" => "multi1"}, {"bar" => "multi2"}).should equal(ENV)
ENV["foo"].should == "0" ENV["foo"].should == "multi1"
ENV["bar"].should == "1" ENV["bar"].should == "multi2"
ENV["baz"].should == "2"
end end
end end

View File

@ -18,7 +18,8 @@ describe "DateTime#to_time" do
time.sec.should == 59 time.sec.should == 59
end end
version_is(Date::VERSION, '3.2.3') do date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
version_is(date_version, '3.2.3') do
it "returns a Time representing the same instant before Gregorian" do it "returns a Time representing the same instant before Gregorian" do
datetime = DateTime.civil(1582, 10, 4, 23, 58, 59) datetime = DateTime.civil(1582, 10, 4, 23, 58, 59)
time = datetime.to_time.utc time = datetime.to_time.utc

View File

@ -13,7 +13,8 @@ describe "Time#to_datetime" do
datetime.sec.should == 59 datetime.sec.should == 59
end end
version_is(Date::VERSION, '3.2.3') do date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
version_is(date_version, '3.2.3') do
it "returns a DateTime representing the same instant before Gregorian" do it "returns a DateTime representing the same instant before Gregorian" do
time = Time.utc(1582, 10, 14, 23, 58, 59) time = Time.utc(1582, 10, 14, 23, 58, 59)
datetime = time.to_datetime datetime = time.to_datetime