From a2c92c13ee64c0adf79d5bbbf2e4d33d5b656f4a Mon Sep 17 00:00:00 2001 From: Herwin Date: Thu, 29 May 2025 07:35:23 +0200 Subject: [PATCH 1/2] Add spec for Warning.categories --- core/warning/categories_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 core/warning/categories_spec.rb diff --git a/core/warning/categories_spec.rb b/core/warning/categories_spec.rb new file mode 100644 index 0000000000..ee8b9f750f --- /dev/null +++ b/core/warning/categories_spec.rb @@ -0,0 +1,9 @@ +require_relative '../../spec_helper' + +ruby_version_is "3.4" do + describe "Warning.categories" do + it "returns the list of possible warning categories" do + Warning.categories.sort.should == [:deprecated, :experimental, :performance, :strict_unused_block] + end + end +end From 1ca58c58f36b752dc004686248f87009429a5503 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 4 Jan 2026 12:58:46 +0100 Subject: [PATCH 2/2] Only spec standard Warning.categories --- core/warning/categories_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/warning/categories_spec.rb b/core/warning/categories_spec.rb index ee8b9f750f..1e310ef38b 100644 --- a/core/warning/categories_spec.rb +++ b/core/warning/categories_spec.rb @@ -2,8 +2,11 @@ ruby_version_is "3.4" do describe "Warning.categories" do + # There might be more, but these are standard across Ruby implementations it "returns the list of possible warning categories" do - Warning.categories.sort.should == [:deprecated, :experimental, :performance, :strict_unused_block] + Warning.categories.should.include? :deprecated + Warning.categories.should.include? :experimental + Warning.categories.should.include? :performance end end end