require 'date' describe :datetime_sec, shared: true do it "returns 0 seconds if passed no arguments" do d = DateTime.new d.send(@method).should == 0 end it "returns the seconds passed in the arguments" do new_datetime(second: 5).send(@method).should == 5 end it "adds 60 to negative values" do new_datetime(second: -20).send(@method).should == 40 end it "returns the absolute value of a Rational" do new_datetime(second: 5 + Rational(1,2)).send(@method).should == 5 end it "returns the absolute value of a float" do new_datetime(second: 5.5).send(@method).should == 5 end it "raises an error when minute is given as a rational" do -> { new_datetime(minute: 5 + Rational(1,2)) }.should raise_error(ArgumentError) end it "raises an error, when the second is smaller than -60" do -> { new_datetime(second: -61) }.should raise_error(ArgumentError) end it "raises an error, when the second is greater or equal than 60" do -> { new_datetime(second: 60) }.should raise_error(ArgumentError) end it "raises an error for second fractions smaller than -60" do -> { new_datetime(second: -60 - Rational(1,2))}.should( raise_error(ArgumentError)) end it "takes a second fraction near 60" do new_datetime(second: 59 + Rational(1,2)).send(@method).should == 59 end end ruby_2_4 The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc_compact.rb
AgeCommit message (Expand)Author
2021-12-17Send the message for s390x to stderr [ci skip]Nobuyoshi Nakada
2021-11-04test/ruby/test_gc_compact.rb: Backpatch the URL to the PRYusuke Endoh
2021-11-04test/ruby/test_gc_compact.rb: Do not run on s390xYusuke Endoh
2021-08-02Stop infinite object allocation to get rid of OOM killerNobuyoshi Nakada
2021-05-25Disable compaction on platforms that can't support itAaron Patterson
2021-04-09test/ruby/test_gc_compact.rb: Use assert_separately for debuggingYusuke Endoh
2021-02-25Revert "Add tests for bug 17652"Aaron Patterson
2021-02-25Add tests for bug 17652Peter Zhu
2021-02-24Reverting PR #4221Aaron Patterson
2021-02-24Add tests for bug 17652Peter Zhu
2020-11-25Disable auto compaction on platforms that can't support itAaron Patterson
2020-11-24Revert "Disable auto compaction on platforms that can't support it"Aaron Patterson
2020-11-24Disable auto compaction on platforms that can't support itAaron Patterson
2020-11-03test/ruby/test_gc_compact.rb: suppress "assigned but unused variable"Yusuke Endoh
2020-11-02Add `GC.auto_compact= true/false` and `GC.auto_compact`Aaron Patterson
2020-01-27Moved `GC.verify_compaction_references` to gc.rbNobuyoshi Nakada
2019-11-07Add a counter for compactionAaron Patterson
2019-11-07Use a monotonically increasing number for object_idJohn Hawthorn
2019-11-06Revert "Use a monotonically increasing number for object_id"Aaron Patterson
2019-11-06Use a monotonically increasing number for object_idJohn Hawthorn
2019-09-26Add compaction support to `rb_ast_t`Aaron Patterson
2019-06-30Skip instead of returnNobuyoshi Nakada
2019-06-30Suppress unused variable warningsNobuyoshi Nakada
2019-05-23Test GC.compact with MJIT againTakashi Kokubun
2019-05-23Do not kick finalizers on rb_gc().Koichi Sasada
2019-05-21re-skip tests of GC.compact.Koichi Sasada
2019-05-21enable test for GC.compact to reproduce an issue on CIKoichi Sasada
2019-05-17skip tests for GC.compact to pass CI.Koichi Sasada
2019-05-14Add object packing strategies for compactionAaron Patterson
2019-04-23Fix complex hash keys to work with compactionAaron Patterson
2019-04-20skip test until we can guarantee movement of certain objectstenderlove
2019-04-20skip test if mjit is enabledtenderlove
2019-04-20Workaround Wercker check which is not working nowk0kubun
2019-04-20Skip test_find_collided_object on problematic CIs for nowk0kubun
2019-04-20add more assertions around moved objecttenderlove
2019-04-20check the index rather than includetenderlove
2019-04-20Try harder to make objects movetenderlove
2019-04-20Add `GC.compact` again.tenderlove
2019-04-17Reverting compaction for nowtenderlove
2019-04-17call verification method in addition to compactiontenderlove
2019-04-17Adding `GC.compact` and compacting GC support.tenderlove
2019-04-10Reverting all commits from r67479 to r67496 because of CI failureskazu
2019-04-09Don't fail the build if we can't get objects to movetenderlove
2019-04-09Try to make compaction more likelytenderlove
2019-04-09Adding `GC.compact` and compacting GC support.tenderlove