summaryrefslogtreecommitdiff
path: root/spec/ruby/core/warning/element_reference_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/warning/element_reference_spec.rb')
-rw-r--r--spec/ruby/core/warning/element_reference_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/warning/element_reference_spec.rb b/spec/ruby/core/warning/element_reference_spec.rb
new file mode 100644
index 0000000000..c3bf06a95b
--- /dev/null
+++ b/spec/ruby/core/warning/element_reference_spec.rb
@@ -0,0 +1,14 @@
+require_relative '../../spec_helper'
+
+ruby_version_is '2.7.2' do
+ describe "Warning.[]" do
+ it "returns default values for categories :deprecated and :experimental" do
+ ruby_exe('p Warning[:deprecated]').chomp.should == "false"
+ ruby_exe('p Warning[:experimental]').chomp.should == "true"
+ end
+
+ it "raises for unknown category" do
+ -> { Warning[:noop] }.should raise_error(ArgumentError, /unknown category: noop/)
+ end
+ end
+end