Skip to content

Commit

Permalink
Add specs Struct#initialize warns about passing only keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi authored and eregon committed Oct 7, 2022
1 parent 4281f46 commit 22bb5b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/struct/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 22bb5b2

Please sign in to comment.