File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -522,17 +522,20 @@ def obj.to_int; 3; end
522
522
Time . new ( "2021-12-25 00:00:00.123456789876 +09:00" , precision : 3 r) . subsec . should == 0.123 r
523
523
end
524
524
525
- it "raise TypeError is can't convert precision keyword argument into Integer " do
526
- error_msg =
527
- if "3.3" <= RUBY_VERSION
528
- "no implicit conversion of String into Integer"
529
- else
530
- "no implicit conversion from string"
531
- end
525
+ ruby_version_is "" ... "3.3 " do
526
+ it "raise TypeError is can't convert precision keyword argument into Integer" do
527
+ -> {
528
+ Time . new ( "2021-12-25 00:00:00.123456789876 +09:00" , precision : "" )
529
+ } . should raise_error ( TypeError , "no implicit conversion from string" )
530
+ end
531
+ end
532
532
533
- -> {
534
- Time . new ( "2021-12-25 00:00:00.123456789876 +09:00" , precision : "" )
535
- } . should raise_error ( TypeError , error_msg )
533
+ ruby_version_is "3.3" do
534
+ it "raise TypeError is can't convert precision keyword argument into Integer" do
535
+ -> {
536
+ Time . new ( "2021-12-25 00:00:00.123456789876 +09:00" , precision : "" )
537
+ } . should raise_error ( TypeError , "no implicit conversion of String into Integer" )
538
+ end
536
539
end
537
540
538
541
it "raises ArgumentError if part of time string is missing" do
You can’t perform that action at this time.
0 commit comments