From 3fb25895ede7ae3dffb706a60878d14ee7c0d425 Mon Sep 17 00:00:00 2001 From: mario Date: Mon, 3 Oct 2022 17:38:11 +0200 Subject: [PATCH] Add specs Struct#initialize warns about passing only keyword arguments --- core/struct/initialize_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/struct/initialize_spec.rb b/core/struct/initialize_spec.rb index e82289071a..d0398c7d3b 100644 --- a/core/struct/initialize_spec.rb +++ b/core/struct/initialize_spec.rb @@ -40,4 +40,12 @@ it "can be overridden" do StructClasses::SubclassX.new(:y).new.key.should == :value end + + ruby_version_is "3.1" do + it "warns about passing only keyword arguments" do + -> { + StructClasses::Ruby.new(version: "3.1", platform: "OS") + }.should complain(/warning: Passing only keyword arguments/) + end + end end