From 7bbecaec118c7428baacec6d3cb181ce6024b383 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Wed, 19 Nov 2025 23:40:27 +0200 Subject: [PATCH] Replace 3.5 with 4.0 in version guards --- command_line/dash_0_spec.rb | 2 +- core/enumerable/to_set_spec.rb | 4 ++-- core/file/stat/birthtime_spec.rb | 2 +- core/kernel/caller_locations_spec.rb | 4 ++-- core/kernel/caller_spec.rb | 4 ++-- core/kernel/inspect_spec.rb | 2 +- core/kernel/require_spec.rb | 4 ++-- core/marshal/dump_spec.rb | 6 +++--- core/method/source_location_spec.rb | 4 ++-- core/module/ruby2_keywords_spec.rb | 2 +- core/module/set_temporary_name_spec.rb | 2 +- core/objectspace/_id2ref_spec.rb | 4 ++-- core/proc/ruby2_keywords_spec.rb | 2 +- core/proc/source_location_spec.rb | 8 ++++---- core/process/status/bit_and_spec.rb | 4 ++-- core/process/status/right_shift_spec.rb | 4 ++-- core/range/max_spec.rb | 4 ++-- core/range/reverse_each_spec.rb | 2 +- core/set/compare_by_identity_spec.rb | 4 ++-- core/set/divide_spec.rb | 4 ++-- core/set/equal_value_spec.rb | 2 +- core/set/flatten_merge_spec.rb | 2 +- core/set/flatten_spec.rb | 4 ++-- core/set/hash_spec.rb | 2 +- core/set/join_spec.rb | 2 +- core/set/pretty_print_cycle_spec.rb | 4 ++-- core/set/proper_subset_spec.rb | 2 +- core/set/proper_superset_spec.rb | 2 +- core/set/shared/inspect.rb | 8 ++++---- core/set/sortedset/sortedset_spec.rb | 2 +- core/set/subset_spec.rb | 2 +- core/set/superset_spec.rb | 2 +- core/unboundmethod/source_location_spec.rb | 4 ++-- language/numbered_parameters_spec.rb | 4 ++-- language/predefined_spec.rb | 8 ++++---- language/regexp_spec.rb | 2 +- language/send_spec.rb | 2 +- language/variables_spec.rb | 4 ++-- library/cgi/cookie/domain_spec.rb | 2 +- library/cgi/cookie/expires_spec.rb | 2 +- library/cgi/cookie/initialize_spec.rb | 2 +- library/cgi/cookie/name_spec.rb | 2 +- library/cgi/cookie/parse_spec.rb | 2 +- library/cgi/cookie/path_spec.rb | 2 +- library/cgi/cookie/secure_spec.rb | 2 +- library/cgi/cookie/to_s_spec.rb | 2 +- library/cgi/cookie/value_spec.rb | 2 +- library/cgi/escapeElement_spec.rb | 4 ++-- library/cgi/htmlextension/a_spec.rb | 2 +- library/cgi/htmlextension/base_spec.rb | 2 +- library/cgi/htmlextension/blockquote_spec.rb | 2 +- library/cgi/htmlextension/br_spec.rb | 2 +- library/cgi/htmlextension/caption_spec.rb | 2 +- library/cgi/htmlextension/checkbox_group_spec.rb | 2 +- library/cgi/htmlextension/checkbox_spec.rb | 2 +- library/cgi/htmlextension/doctype_spec.rb | 2 +- library/cgi/htmlextension/file_field_spec.rb | 2 +- library/cgi/htmlextension/form_spec.rb | 2 +- library/cgi/htmlextension/frame_spec.rb | 2 +- library/cgi/htmlextension/frameset_spec.rb | 2 +- library/cgi/htmlextension/hidden_spec.rb | 2 +- library/cgi/htmlextension/html_spec.rb | 2 +- library/cgi/htmlextension/image_button_spec.rb | 2 +- library/cgi/htmlextension/img_spec.rb | 2 +- library/cgi/htmlextension/multipart_form_spec.rb | 2 +- library/cgi/htmlextension/password_field_spec.rb | 2 +- library/cgi/htmlextension/popup_menu_spec.rb | 2 +- library/cgi/htmlextension/radio_button_spec.rb | 2 +- library/cgi/htmlextension/radio_group_spec.rb | 2 +- library/cgi/htmlextension/reset_spec.rb | 2 +- library/cgi/htmlextension/scrolling_list_spec.rb | 2 +- library/cgi/htmlextension/submit_spec.rb | 2 +- library/cgi/htmlextension/text_field_spec.rb | 2 +- library/cgi/htmlextension/textarea_spec.rb | 2 +- library/cgi/http_header_spec.rb | 2 +- library/cgi/initialize_spec.rb | 2 +- library/cgi/out_spec.rb | 2 +- library/cgi/parse_spec.rb | 2 +- library/cgi/pretty_spec.rb | 2 +- library/cgi/print_spec.rb | 2 +- library/cgi/queryextension/accept_charset_spec.rb | 2 +- library/cgi/queryextension/accept_encoding_spec.rb | 2 +- library/cgi/queryextension/accept_language_spec.rb | 2 +- library/cgi/queryextension/accept_spec.rb | 2 +- library/cgi/queryextension/auth_type_spec.rb | 2 +- library/cgi/queryextension/cache_control_spec.rb | 2 +- library/cgi/queryextension/content_length_spec.rb | 2 +- library/cgi/queryextension/content_type_spec.rb | 2 +- library/cgi/queryextension/cookies_spec.rb | 2 +- library/cgi/queryextension/element_reference_spec.rb | 2 +- library/cgi/queryextension/from_spec.rb | 2 +- library/cgi/queryextension/gateway_interface_spec.rb | 2 +- library/cgi/queryextension/has_key_spec.rb | 2 +- library/cgi/queryextension/host_spec.rb | 2 +- library/cgi/queryextension/include_spec.rb | 2 +- library/cgi/queryextension/key_spec.rb | 2 +- library/cgi/queryextension/keys_spec.rb | 2 +- library/cgi/queryextension/multipart_spec.rb | 2 +- library/cgi/queryextension/negotiate_spec.rb | 2 +- library/cgi/queryextension/params_spec.rb | 2 +- library/cgi/queryextension/path_info_spec.rb | 2 +- library/cgi/queryextension/path_translated_spec.rb | 2 +- library/cgi/queryextension/pragma_spec.rb | 2 +- library/cgi/queryextension/query_string_spec.rb | 2 +- library/cgi/queryextension/raw_cookie2_spec.rb | 2 +- library/cgi/queryextension/raw_cookie_spec.rb | 2 +- library/cgi/queryextension/referer_spec.rb | 2 +- library/cgi/queryextension/remote_addr_spec.rb | 2 +- library/cgi/queryextension/remote_host_spec.rb | 2 +- library/cgi/queryextension/remote_ident_spec.rb | 2 +- library/cgi/queryextension/remote_user_spec.rb | 2 +- library/cgi/queryextension/request_method_spec.rb | 2 +- library/cgi/queryextension/script_name_spec.rb | 2 +- library/cgi/queryextension/server_name_spec.rb | 2 +- library/cgi/queryextension/server_port_spec.rb | 2 +- library/cgi/queryextension/server_protocol_spec.rb | 2 +- library/cgi/queryextension/server_software_spec.rb | 2 +- library/cgi/queryextension/user_agent_spec.rb | 2 +- library/cgi/rfc1123_date_spec.rb | 2 +- library/cgi/unescapeElement_spec.rb | 4 ++-- library/cgi/unescape_spec.rb | 4 ++-- library/net-http/http/post_spec.rb | 2 +- library/net-http/httpgenericrequest/exec_spec.rb | 4 ++-- library/stringscanner/check_spec.rb | 4 ---- library/stringscanner/check_until_spec.rb | 6 ------ library/stringscanner/exist_spec.rb | 4 ---- library/stringscanner/get_byte_spec.rb | 4 ---- library/stringscanner/getch_spec.rb | 4 ---- library/stringscanner/scan_byte_spec.rb | 4 ---- library/stringscanner/scan_integer_spec.rb | 8 +------- library/stringscanner/scan_until_spec.rb | 6 ------ library/stringscanner/search_full_spec.rb | 4 ---- library/stringscanner/skip_until_spec.rb | 6 ------ optional/capi/ext/rubyspec.h | 4 ++-- optional/capi/ext/set_spec.c | 2 +- optional/capi/ext/thread_spec.c | 4 ++-- optional/capi/set_spec.rb | 2 +- optional/capi/string_spec.rb | 6 +++--- optional/capi/thread_spec.rb | 2 +- security/cve_2020_10663_spec.rb | 2 +- shared/kernel/raise.rb | 4 ++-- 141 files changed, 168 insertions(+), 216 deletions(-) diff --git a/command_line/dash_0_spec.rb b/command_line/dash_0_spec.rb index 73c5e29004..2ce4f49b5e 100755 --- a/command_line/dash_0_spec.rb +++ b/command_line/dash_0_spec.rb @@ -5,7 +5,7 @@ ruby_exe("puts $/, $-0", options: "-072").should == ":\n:\n" end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "sets $/ and $-0 as a frozen string" do ruby_exe("puts $/.frozen?, $-0.frozen?", options: "-072").should == "true\ntrue\n" end diff --git a/core/enumerable/to_set_spec.rb b/core/enumerable/to_set_spec.rb index e0437fea61..e1fcd3a20d 100644 --- a/core/enumerable/to_set_spec.rb +++ b/core/enumerable/to_set_spec.rb @@ -11,7 +11,7 @@ [1, 2, 3].to_set { |x| x * x }.should == Set[1, 4, 9] end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "instantiates an object of provided as the first argument set class" do set = nil proc{set = [1, 2, 3].to_set(EnumerableSpecs::SetSubclass)}.should complain(/Enumerable#to_set/) @@ -20,7 +20,7 @@ end end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "instantiates an object of provided as the first argument set class" do set = [1, 2, 3].to_set(EnumerableSpecs::SetSubclass) set.should be_kind_of(EnumerableSpecs::SetSubclass) diff --git a/core/file/stat/birthtime_spec.rb b/core/file/stat/birthtime_spec.rb index adecee15b0..9aa39297b2 100644 --- a/core/file/stat/birthtime_spec.rb +++ b/core/file/stat/birthtime_spec.rb @@ -1,7 +1,7 @@ require_relative '../../../spec_helper' platform_is(:windows, :darwin, :freebsd, :netbsd, - *ruby_version_is("3.5") { :linux }, + *ruby_version_is("4.0") { :linux }, ) do not_implemented_messages = [ "birthtime() function is unimplemented", # unsupported OS/version diff --git a/core/kernel/caller_locations_spec.rb b/core/kernel/caller_locations_spec.rb index 6074879d59..a917dba504 100644 --- a/core/kernel/caller_locations_spec.rb +++ b/core/kernel/caller_locations_spec.rb @@ -83,7 +83,7 @@ end end - ruby_version_is "3.4"..."3.5" do + ruby_version_is "3.4"..."4.0" do it "includes core library methods defined in Ruby" do file, line = Kernel.instance_method(:tap).source_location file.should.start_with?(' { Kernel.instance_method(:tap).source_location } do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "includes core library methods defined in Ruby" do file, line = Kernel.instance_method(:tap).source_location file.should.start_with?(' *a, b { } diff --git a/core/proc/source_location_spec.rb b/core/proc/source_location_spec.rb index 484466f577..69b4e2fd82 100644 --- a/core/proc/source_location_spec.rb +++ b/core/proc/source_location_spec.rb @@ -53,12 +53,12 @@ end it "works even if the proc was created on the same line" do - ruby_version_is(""..."3.5") do + ruby_version_is(""..."4.0") do proc { true }.source_location.should == [__FILE__, __LINE__] Proc.new { true }.source_location.should == [__FILE__, __LINE__] -> { true }.source_location.should == [__FILE__, __LINE__] end - ruby_version_is("3.5") do + ruby_version_is("4.0") do proc { true }.source_location.should == [__FILE__, __LINE__, 11, __LINE__, 19] Proc.new { true }.source_location.should == [__FILE__, __LINE__, 15, __LINE__, 23] -> { true }.source_location.should == [__FILE__, __LINE__, 8, __LINE__, 17] @@ -94,10 +94,10 @@ it "works for eval with a given line" do proc = eval('-> {}', nil, "foo", 100) location = proc.source_location - ruby_version_is(""..."3.5") do + ruby_version_is(""..."4.0") do location.should == ["foo", 100] end - ruby_version_is("3.5") do + ruby_version_is("4.0") do location.should == ["foo", 100, 2, 100, 5] end end diff --git a/core/process/status/bit_and_spec.rb b/core/process/status/bit_and_spec.rb index 0e0edb0afa..a805364629 100644 --- a/core/process/status/bit_and_spec.rb +++ b/core/process/status/bit_and_spec.rb @@ -1,6 +1,6 @@ require_relative '../../../spec_helper' -ruby_version_is ""..."3.5" do +ruby_version_is ""..."4.0" do describe "Process::Status#&" do it "returns a bitwise and of the integer status of an exited child" do @@ -17,7 +17,7 @@ end end - ruby_version_is "3.3"..."3.5" do + ruby_version_is "3.3"..."4.0" do it "raises an ArgumentError if mask is negative" do suppress_warning do ruby_exe("exit(0)") diff --git a/core/process/status/right_shift_spec.rb b/core/process/status/right_shift_spec.rb index a1ab75141a..355aaf4c95 100644 --- a/core/process/status/right_shift_spec.rb +++ b/core/process/status/right_shift_spec.rb @@ -1,6 +1,6 @@ require_relative '../../../spec_helper' -ruby_version_is ""..."3.5" do +ruby_version_is ""..."4.0" do describe "Process::Status#>>" do it "returns a right shift of the integer status of an exited child" do @@ -16,7 +16,7 @@ end end - ruby_version_is "3.3"..."3.5" do + ruby_version_is "3.3"..."4.0" do it "raises an ArgumentError if shift value is negative" do suppress_warning do ruby_exe("exit(0)") diff --git a/core/range/max_spec.rb b/core/range/max_spec.rb index 8b83f69a5a..09371f5298 100644 --- a/core/range/max_spec.rb +++ b/core/range/max_spec.rb @@ -55,7 +55,7 @@ (..1.0).max.should == 1.0 end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "raises for an exclusive beginless Integer range" do -> { (...1).max @@ -63,7 +63,7 @@ end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "returns the end point for exclusive beginless Integer ranges" do (...1).max.should == 0 end diff --git a/core/range/reverse_each_spec.rb b/core/range/reverse_each_spec.rb index b51e04c3ff..56390cc0da 100644 --- a/core/range/reverse_each_spec.rb +++ b/core/range/reverse_each_spec.rb @@ -88,7 +88,7 @@ (1..3).reverse_each.size.should == 3 end - ruby_bug "#20936", "3.4"..."3.5" do + ruby_bug "#20936", "3.4"..."4.0" do it "returns Infinity when Range size is infinite" do (..3).reverse_each.size.should == Float::INFINITY end diff --git a/core/set/compare_by_identity_spec.rb b/core/set/compare_by_identity_spec.rb index 0dda6d79f0..238dc117a6 100644 --- a/core/set/compare_by_identity_spec.rb +++ b/core/set/compare_by_identity_spec.rb @@ -90,7 +90,7 @@ def o.hash; 123; end set.to_a.sort.should == [a1, a2].sort end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "raises a FrozenError on frozen sets" do set = Set.new.freeze -> { @@ -99,7 +99,7 @@ def o.hash; 123; end end end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "raises a FrozenError on frozen sets" do set = Set.new.freeze -> { diff --git a/core/set/divide_spec.rb b/core/set/divide_spec.rb index cbe0042f16..c6c6003e99 100644 --- a/core/set/divide_spec.rb +++ b/core/set/divide_spec.rb @@ -25,7 +25,7 @@ set.map{ |x| x.to_a.sort }.sort.should == [[1], [3, 4], [6], [9, 10, 11]] end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "yields each two Object to the block" do ret = [] Set[1, 2].divide { |x, y| ret << [x, y] } @@ -33,7 +33,7 @@ end end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "yields each two Object to the block" do ret = [] Set[1, 2].divide { |x, y| ret << [x, y] } diff --git a/core/set/equal_value_spec.rb b/core/set/equal_value_spec.rb index e3514928c8..721a79a3f1 100644 --- a/core/set/equal_value_spec.rb +++ b/core/set/equal_value_spec.rb @@ -24,7 +24,7 @@ set1.should == set2 end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when comparing to a Set-like object" do it "returns true when a Set and a Set-like object contain the same elements" do Set[1, 2, 3].should == SetSpecs::SetLike.new([1, 2, 3]) diff --git a/core/set/flatten_merge_spec.rb b/core/set/flatten_merge_spec.rb index d7c2b30657..13cedeead9 100644 --- a/core/set/flatten_merge_spec.rb +++ b/core/set/flatten_merge_spec.rb @@ -1,7 +1,7 @@ require_relative '../../spec_helper' describe "Set#flatten_merge" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "is protected" do Set.should have_protected_instance_method("flatten_merge") end diff --git a/core/set/flatten_spec.rb b/core/set/flatten_spec.rb index 870eccc2f1..f2cb3dfa52 100644 --- a/core/set/flatten_spec.rb +++ b/core/set/flatten_spec.rb @@ -16,7 +16,7 @@ -> { set.flatten }.should raise_error(ArgumentError) end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when Set contains a Set-like object" do it "returns a copy of self with each included Set-like object flattened" do Set[SetSpecs::SetLike.new([1])].flatten.should == Set[1] @@ -48,7 +48,7 @@ end version_is(set_version, ""..."1.1.0") do #ruby_version_is ""..."3.3" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when Set contains a Set-like object" do it "flattens self, including Set-like objects" do Set[SetSpecs::SetLike.new([1])].flatten!.should == Set[1] diff --git a/core/set/hash_spec.rb b/core/set/hash_spec.rb index 4b4696e34c..63a0aa66a5 100644 --- a/core/set/hash_spec.rb +++ b/core/set/hash_spec.rb @@ -10,7 +10,7 @@ Set[1, 2, 3].hash.should_not == Set[:a, "b", ?c].hash end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do # see https://github.com/jruby/jruby/issues/8393 it "is equal to nil.hash for an uninitialized Set" do Set.allocate.hash.should == nil.hash diff --git a/core/set/join_spec.rb b/core/set/join_spec.rb index cdb593597d..1c1e8a8af8 100644 --- a/core/set/join_spec.rb +++ b/core/set/join_spec.rb @@ -20,7 +20,7 @@ set.join(' | ').should == "a | b | c" end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "calls #to_a to convert the Set in to an Array" do set = Set[:a, :b, :c] set.should_receive(:to_a).and_return([:a, :b, :c]) diff --git a/core/set/pretty_print_cycle_spec.rb b/core/set/pretty_print_cycle_spec.rb index d4cca515e2..7e6017c112 100644 --- a/core/set/pretty_print_cycle_spec.rb +++ b/core/set/pretty_print_cycle_spec.rb @@ -3,10 +3,10 @@ describe "Set#pretty_print_cycle" do it "passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" do pp = mock("PrettyPrint") - ruby_version_is(""..."3.5") do + ruby_version_is(""..."4.0") do pp.should_receive(:text).with("#") end - ruby_version_is("3.5") do + ruby_version_is("4.0") do pp.should_receive(:text).with("Set[...]") end Set[1, 2, 3].pretty_print_cycle(pp) diff --git a/core/set/proper_subset_spec.rb b/core/set/proper_subset_spec.rb index a84c4197c2..fb7848c001 100644 --- a/core/set/proper_subset_spec.rb +++ b/core/set/proper_subset_spec.rb @@ -34,7 +34,7 @@ end version_is(set_version, ""..."1.1.0") do #ruby_version_is ""..."3.3" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when comparing to a Set-like object" do it "returns true if passed a Set-like object that self is a proper subset of" do Set[1, 2, 3].proper_subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true diff --git a/core/set/proper_superset_spec.rb b/core/set/proper_superset_spec.rb index 653411f6b2..dc1e87e230 100644 --- a/core/set/proper_superset_spec.rb +++ b/core/set/proper_superset_spec.rb @@ -32,7 +32,7 @@ -> { Set[].proper_superset?(Object.new) }.should raise_error(ArgumentError) end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when comparing to a Set-like object" do it "returns true if passed a Set-like object that self is a proper superset of" do Set[1, 2, 3, 4].proper_superset?(SetSpecs::SetLike.new([1, 2, 3])).should be_true diff --git a/core/set/shared/inspect.rb b/core/set/shared/inspect.rb index fbc7486acd..a90af66c98 100644 --- a/core/set/shared/inspect.rb +++ b/core/set/shared/inspect.rb @@ -7,13 +7,13 @@ Set[:a, "b", Set[?c]].send(@method).should be_kind_of(String) end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "does include the elements of the set" do Set["1"].send(@method).should == 'Set["1"]' end end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "does include the elements of the set" do Set["1"].send(@method).should == '#' end @@ -23,7 +23,7 @@ Set["1", "2"].send(@method).should include('", "') end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "correctly handles cyclic-references" do set1 = Set[] set2 = Set[set1] @@ -33,7 +33,7 @@ end end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "correctly handles cyclic-references" do set1 = Set[] set2 = Set[set1] diff --git a/core/set/sortedset/sortedset_spec.rb b/core/set/sortedset/sortedset_spec.rb index 41f010e011..f3c1ec058d 100644 --- a/core/set/sortedset/sortedset_spec.rb +++ b/core/set/sortedset/sortedset_spec.rb @@ -1,7 +1,7 @@ require_relative '../../../spec_helper' describe "SortedSet" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "raises error including message that it has been extracted from the set stdlib" do -> { SortedSet diff --git a/core/set/subset_spec.rb b/core/set/subset_spec.rb index cde61d7cd7..112bd9b38a 100644 --- a/core/set/subset_spec.rb +++ b/core/set/subset_spec.rb @@ -34,7 +34,7 @@ end version_is(set_version, ""..."1.1.0") do #ruby_version_is ""..."3.3" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when comparing to a Set-like object" do it "returns true if passed a Set-like object that self is a subset of" do Set[1, 2, 3].subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true diff --git a/core/set/superset_spec.rb b/core/set/superset_spec.rb index 9d7bab964a..9b3df2d047 100644 --- a/core/set/superset_spec.rb +++ b/core/set/superset_spec.rb @@ -32,7 +32,7 @@ -> { Set[].superset?(Object.new) }.should raise_error(ArgumentError) end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do context "when comparing to a Set-like object" do it "returns true if passed a Set-like object that self is a superset of" do Set[1, 2, 3, 4].superset?(SetSpecs::SetLike.new([1, 2, 3])).should be_true diff --git a/core/unboundmethod/source_location_spec.rb b/core/unboundmethod/source_location_spec.rb index 2391d07d99..85078ff34e 100644 --- a/core/unboundmethod/source_location_spec.rb +++ b/core/unboundmethod/source_location_spec.rb @@ -55,10 +55,10 @@ eval('def m; end', nil, "foo", 100) end location = c.instance_method(:m).source_location - ruby_version_is(""..."3.5") do + ruby_version_is(""..."4.0") do location.should == ["foo", 100] end - ruby_version_is("3.5") do + ruby_version_is("4.0") do location.should == ["foo", 100, 0, 100, 10] end end diff --git a/language/numbered_parameters_spec.rb b/language/numbered_parameters_spec.rb index 39ddd6fee8..de532c326d 100644 --- a/language/numbered_parameters_spec.rb +++ b/language/numbered_parameters_spec.rb @@ -90,14 +90,14 @@ proc { _2 }.parameters.should == [[:opt, :_1], [:opt, :_2]] end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "affects binding local variables" do -> { _1; binding.local_variables }.call("a").should == [:_1] -> { _2; binding.local_variables }.call("a", "b").should == [:_1, :_2] end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "does not affect binding local variables" do -> { _1; binding.local_variables }.call("a").should == [] -> { _2; binding.local_variables }.call("a", "b").should == [] diff --git a/language/predefined_spec.rb b/language/predefined_spec.rb index d90e19858a..f2488615aa 100644 --- a/language/predefined_spec.rb +++ b/language/predefined_spec.rb @@ -687,7 +687,7 @@ def foo $VERBOSE = @verbose end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "can be assigned a String" do str = +"abc" $/ = str @@ -695,7 +695,7 @@ def foo end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "makes a new frozen String from the assigned String" do string_subclass = Class.new(String) str = string_subclass.new("abc") @@ -763,7 +763,7 @@ def foo $VERBOSE = @verbose end - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "can be assigned a String" do str = +"abc" $-0 = str @@ -771,7 +771,7 @@ def foo end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "makes a new frozen String from the assigned String" do string_subclass = Class.new(String) str = string_subclass.new("abc") diff --git a/language/regexp_spec.rb b/language/regexp_spec.rb index dbf341b19e..ce344b5b05 100644 --- a/language/regexp_spec.rb +++ b/language/regexp_spec.rb @@ -112,7 +112,7 @@ /foo.(?<=\d)/.match("fooA foo1").to_a.should == ["foo1"] end - ruby_bug "#13671", ""..."3.5" do # https://bugs.ruby-lang.org/issues/13671 + ruby_bug "#13671", ""..."4.0" do # https://bugs.ruby-lang.org/issues/13671 it "handles a lookbehind with ss characters" do r = Regexp.new("(? "application/x-www-form-urlencoded" }.inspect.delete("{}")) diff --git a/library/net-http/httpgenericrequest/exec_spec.rb b/library/net-http/httpgenericrequest/exec_spec.rb index 0912e5a71f..a09f9d5bec 100644 --- a/library/net-http/httpgenericrequest/exec_spec.rb +++ b/library/net-http/httpgenericrequest/exec_spec.rb @@ -31,7 +31,7 @@ end describe "when a request body is set" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied" do request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path") request.body = "Some Content" @@ -64,7 +64,7 @@ end describe "when a body stream is set" do - ruby_version_is ""..."3.5" do + ruby_version_is ""..."4.0" do it "sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied" do request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Length" => "10") diff --git a/library/stringscanner/check_spec.rb b/library/stringscanner/check_spec.rb index 235f2f22e9..5e855e154a 100644 --- a/library/stringscanner/check_spec.rb +++ b/library/stringscanner/check_spec.rb @@ -39,7 +39,6 @@ context "when #check was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.check("This") @@ -47,7 +46,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "raises IndexError when matching succeeded" do @s.check("This") @@ -68,7 +66,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) @@ -80,7 +77,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) diff --git a/library/stringscanner/check_until_spec.rb b/library/stringscanner/check_until_spec.rb index 701a703ebe..582da66b37 100644 --- a/library/stringscanner/check_until_spec.rb +++ b/library/stringscanner/check_until_spec.rb @@ -35,7 +35,6 @@ end # https://github.com/ruby/strscan/issues/131 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.1" it "sets the last match result if given a String" do @s.check_until("a") @@ -45,7 +44,6 @@ @s.post_match.should == " test" end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "sets the last match result if given a String" do @@ -76,7 +74,6 @@ version_is StringScanner::Version, "3.1.1" do # ruby_version_is "3.4" context "when #check_until was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.check_until("This") @@ -84,7 +81,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do @s.check_until("This") @@ -105,7 +101,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) @@ -117,7 +112,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) diff --git a/library/stringscanner/exist_spec.rb b/library/stringscanner/exist_spec.rb index 3f40c7a5a5..a408fd0b8d 100644 --- a/library/stringscanner/exist_spec.rb +++ b/library/stringscanner/exist_spec.rb @@ -64,7 +64,6 @@ version_is StringScanner::Version, "3.1.1" do # ruby_version_is "3.4" context "when #exist? was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.exist?("This") @@ -72,7 +71,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do @s.exist?("This") @@ -93,7 +91,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) @@ -105,7 +102,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) diff --git a/library/stringscanner/get_byte_spec.rb b/library/stringscanner/get_byte_spec.rb index b3c2b7f678..144859abc9 100644 --- a/library/stringscanner/get_byte_spec.rb +++ b/library/stringscanner/get_byte_spec.rb @@ -32,7 +32,6 @@ describe "#[] successive call with a capture group name" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil" do s = StringScanner.new("This is a test") @@ -41,7 +40,6 @@ s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError" do s = StringScanner.new("This is a test") @@ -58,7 +56,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("This is a test") @@ -71,7 +68,6 @@ s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("This is a test") diff --git a/library/stringscanner/getch_spec.rb b/library/stringscanner/getch_spec.rb index c9c3eb6fd3..d369391b14 100644 --- a/library/stringscanner/getch_spec.rb +++ b/library/stringscanner/getch_spec.rb @@ -33,7 +33,6 @@ describe "#[] successive call with a capture group name" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil" do s = StringScanner.new("This is a test") @@ -42,7 +41,6 @@ s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError" do s = StringScanner.new("This is a test") @@ -59,7 +57,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("This is a test") @@ -73,7 +70,6 @@ s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("This is a test") diff --git a/library/stringscanner/scan_byte_spec.rb b/library/stringscanner/scan_byte_spec.rb index c60e22be4f..aa2decc8f7 100644 --- a/library/stringscanner/scan_byte_spec.rb +++ b/library/stringscanner/scan_byte_spec.rb @@ -43,7 +43,6 @@ describe "#[] successive call with a capture group name" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil" do s = StringScanner.new("abc") @@ -52,7 +51,6 @@ s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError" do s = StringScanner.new("abc") @@ -69,7 +67,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("abc") @@ -83,7 +80,6 @@ s[:a].should == nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do s = StringScanner.new("abc") diff --git a/library/stringscanner/scan_integer_spec.rb b/library/stringscanner/scan_integer_spec.rb index a0b3685bae..fe0d26f404 100644 --- a/library/stringscanner/scan_integer_spec.rb +++ b/library/stringscanner/scan_integer_spec.rb @@ -25,7 +25,7 @@ end # https://github.com/ruby/strscan/issues/130 - ruby_bug "", "3.4"..."3.5" do # introduced in strscan v3.1.1 + ruby_bug "", "3.4"..."4.0" do # introduced in strscan v3.1.1 it "sets the last match result" do s = StringScanner.new("42abc") s.scan_integer @@ -68,7 +68,6 @@ }.should raise_error(ArgumentError, "Unsupported integer base: 5, expected 10 or 16") end - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "does not match '0x' prefix on its own" do StringScanner.new("0x").scan_integer(base: 16).should == nil @@ -76,7 +75,6 @@ StringScanner.new("+0x").scan_integer(base: 16).should == nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "matches '0' in a '0x' that is followed by non-hex characters" do @@ -96,7 +94,6 @@ describe "#[] successive call with a capture group name" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil substring when matching succeeded" do s = StringScanner.new("42") @@ -105,7 +102,6 @@ s[:a].should == nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do s = StringScanner.new("42") @@ -131,7 +127,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "does not ignore the previous matching with Regexp" do s = StringScanner.new("42") @@ -145,7 +140,6 @@ s[:a].should == "42" end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "ignores the previous matching with Regexp" do s = StringScanner.new("42") diff --git a/library/stringscanner/scan_until_spec.rb b/library/stringscanner/scan_until_spec.rb index 737d83a14c..610060d6f1 100644 --- a/library/stringscanner/scan_until_spec.rb +++ b/library/stringscanner/scan_until_spec.rb @@ -41,7 +41,6 @@ end # https://github.com/ruby/strscan/issues/131 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.1" it "sets the last match result if given a String" do @s.scan_until("a") @@ -51,7 +50,6 @@ @s.post_match.should == " test" end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "sets the last match result if given a String" do @@ -82,7 +80,6 @@ version_is StringScanner::Version, "3.1.1" do # ruby_version_is "3.4" context "when #scan_until was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.scan_until("This") @@ -90,7 +87,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do @s.scan_until("This") @@ -111,7 +107,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) @@ -123,7 +118,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) diff --git a/library/stringscanner/search_full_spec.rb b/library/stringscanner/search_full_spec.rb index a089da2043..197adfda4d 100644 --- a/library/stringscanner/search_full_spec.rb +++ b/library/stringscanner/search_full_spec.rb @@ -50,7 +50,6 @@ end # https://github.com/ruby/strscan/issues/131 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.1" it "sets the last match result if given a String" do @s.search_full("is a", false, false) @@ -60,7 +59,6 @@ @s.post_match.should == " test" end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "sets the last match result if given a String" do @@ -91,7 +89,6 @@ version_is StringScanner::Version, "3.1.1" do # ruby_version_is "3.4" context "when #search_full was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.search_full("This", false, false) @@ -99,7 +96,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do @s.search_full("This", false, false) diff --git a/library/stringscanner/skip_until_spec.rb b/library/stringscanner/skip_until_spec.rb index f5be4b5ceb..5d73d8f0b9 100644 --- a/library/stringscanner/skip_until_spec.rb +++ b/library/stringscanner/skip_until_spec.rb @@ -38,7 +38,6 @@ end # https://github.com/ruby/strscan/issues/131 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.1" it "sets the last match result if given a String" do @s.skip_until("a") @@ -48,7 +47,6 @@ @s.post_match.should == " test" end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "sets the last match result if given a String" do @@ -79,7 +77,6 @@ version_is StringScanner::Version, "3.1.1" do # ruby_version_is "3.4" context "when #skip_until was called with a String pattern" do # https://github.com/ruby/strscan/issues/139 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "returns nil when matching succeeded" do @s.skip_until("This") @@ -87,7 +84,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4.3" it "raises IndexError when matching succeeded" do @s.skip_until("This") @@ -108,7 +104,6 @@ end # https://github.com/ruby/strscan/issues/135 - ruby_version_is ""..."3.5" do # Don't run on 3.5.0dev that already contains not released fixes version_is StringScanner::Version, "3.1.1"..."3.1.3" do # ruby_version_is "3.4.0"..."3.4.3" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) @@ -120,7 +115,6 @@ @s[:a].should be_nil end end - end version_is StringScanner::Version, "3.1.3" do # ruby_version_is "3.4" it "ignores the previous matching with Regexp" do @s.exist?(/(?This)/) diff --git a/optional/capi/ext/rubyspec.h b/optional/capi/ext/rubyspec.h index 8aaec36f46..6c4bea5da0 100644 --- a/optional/capi/ext/rubyspec.h +++ b/optional/capi/ext/rubyspec.h @@ -35,8 +35,8 @@ (RUBY_API_VERSION_MAJOR == (major) && RUBY_API_VERSION_MINOR < (minor))) #define RUBY_VERSION_SINCE(major,minor) (!RUBY_VERSION_BEFORE(major, minor)) -#if RUBY_VERSION_SINCE(3, 5) -#define RUBY_VERSION_IS_3_5 +#if RUBY_VERSION_SINCE(4, 0) +#define RUBY_VERSION_IS_4_0 #endif #if RUBY_VERSION_SINCE(3, 4) diff --git a/optional/capi/ext/set_spec.c b/optional/capi/ext/set_spec.c index 7af922fd49..11a271b361 100644 --- a/optional/capi/ext/set_spec.c +++ b/optional/capi/ext/set_spec.c @@ -1,7 +1,7 @@ #include "ruby.h" #include "rubyspec.h" -#ifdef RUBY_VERSION_IS_3_5 +#ifdef RUBY_VERSION_IS_4_0 #ifdef __cplusplus extern "C" { #endif diff --git a/optional/capi/ext/thread_spec.c b/optional/capi/ext/thread_spec.c index 6ee111b7b7..ac77e4e813 100644 --- a/optional/capi/ext/thread_spec.c +++ b/optional/capi/ext/thread_spec.c @@ -166,7 +166,7 @@ static VALUE thread_spec_ruby_native_thread_p_new_thread(VALUE self) { #endif } -#ifdef RUBY_VERSION_IS_3_5 +#ifdef RUBY_VERSION_IS_4_0 static VALUE thread_spec_ruby_thread_has_gvl_p(VALUE self) { return ruby_thread_has_gvl_p() ? Qtrue : Qfalse; } @@ -185,7 +185,7 @@ void Init_thread_spec(void) { rb_define_method(cls, "rb_thread_create", thread_spec_rb_thread_create, 2); rb_define_method(cls, "ruby_native_thread_p", thread_spec_ruby_native_thread_p, 0); rb_define_method(cls, "ruby_native_thread_p_new_thread", thread_spec_ruby_native_thread_p_new_thread, 0); -#ifdef RUBY_VERSION_IS_3_5 +#ifdef RUBY_VERSION_IS_4_0 rb_define_method(cls, "ruby_thread_has_gvl_p", thread_spec_ruby_thread_has_gvl_p, 0); #endif } diff --git a/optional/capi/set_spec.rb b/optional/capi/set_spec.rb index 3b7ee812c5..3e35be0505 100644 --- a/optional/capi/set_spec.rb +++ b/optional/capi/set_spec.rb @@ -1,6 +1,6 @@ require_relative 'spec_helper' -ruby_version_is "3.5" do +ruby_version_is "4.0" do load_extension("set") describe "C-API Set function" do diff --git a/optional/capi/string_spec.rb b/optional/capi/string_spec.rb index 605c43769d..72f20ee6a5 100644 --- a/optional/capi/string_spec.rb +++ b/optional/capi/string_spec.rb @@ -193,7 +193,7 @@ def inspect it "returns a new String object filled with \\0 bytes" do lens = [4] - ruby_version_is "3.5" do + ruby_version_is "4.0" do lens << 100 end @@ -1230,7 +1230,7 @@ def inspect -> { str.upcase! }.should raise_error(RuntimeError, 'can\'t modify string; temporarily locked') end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "raises FrozenError if string is frozen" do str = -"rb_str_locktmp" -> { @s.rb_str_locktmp(str) }.should raise_error(FrozenError) @@ -1254,7 +1254,7 @@ def inspect -> { @s.rb_str_unlocktmp(+"test") }.should raise_error(RuntimeError, 'temporal unlocking already unlocked string') end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "raises FrozenError if string is frozen" do str = -"rb_str_locktmp" -> { @s.rb_str_unlocktmp(str) }.should raise_error(FrozenError) diff --git a/optional/capi/thread_spec.rb b/optional/capi/thread_spec.rb index cd9ae8ff19..117726f0e2 100644 --- a/optional/capi/thread_spec.rb +++ b/optional/capi/thread_spec.rb @@ -185,7 +185,7 @@ def call_capi_rb_thread_wakeup end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do describe "ruby_thread_has_gvl_p" do it "returns true if the current thread has the GVL" do @t.ruby_thread_has_gvl_p.should be_true diff --git a/security/cve_2020_10663_spec.rb b/security/cve_2020_10663_spec.rb index 80e860348b..c44a13a0dd 100644 --- a/security/cve_2020_10663_spec.rb +++ b/security/cve_2020_10663_spec.rb @@ -1,6 +1,6 @@ require_relative '../spec_helper' -ruby_version_is ""..."3.5" do +ruby_version_is ""..."4.0" do require 'json' module JSONSpecs diff --git a/shared/kernel/raise.rb b/shared/kernel/raise.rb index 8432c83594..2be06ea797 100644 --- a/shared/kernel/raise.rb +++ b/shared/kernel/raise.rb @@ -141,7 +141,7 @@ def e.exception end end - ruby_version_is "3.5" do + ruby_version_is "4.0" do it "allows cause keyword argument" do cause = StandardError.new("original error") result = nil @@ -272,7 +272,7 @@ def e.exception end describe :kernel_raise_across_contexts, shared: true do - ruby_version_is "3.5" do + ruby_version_is "4.0" do describe "with cause keyword argument" do it "uses the cause from the calling context" do original_cause = nil