diff options
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/module/ruby2_keywords_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/language/hash_spec.rb | 18 | ||||
-rw-r--r-- | spec/ruby/language/keyword_arguments_spec.rb | 15 |
3 files changed, 19 insertions, 15 deletions
diff --git a/spec/ruby/core/module/ruby2_keywords_spec.rb b/spec/ruby/core/module/ruby2_keywords_spec.rb index dc16d712c7..a72612a670 100644 --- a/spec/ruby/core/module/ruby2_keywords_spec.rb +++ b/spec/ruby/core/module/ruby2_keywords_spec.rb @@ -22,7 +22,6 @@ describe "Module#ruby2_keywords" do end h = {a: 1} - obj.regular(**h).should.equal?(h) last = mark(**h).last Hash.ruby2_keywords_hash?(last).should == true diff --git a/spec/ruby/language/hash_spec.rb b/spec/ruby/language/hash_spec.rb index 9e2b9bd4c5..6ac382c42c 100644 --- a/spec/ruby/language/hash_spec.rb +++ b/spec/ruby/language/hash_spec.rb @@ -220,15 +220,17 @@ describe "The ** operator" do h.should == { one: 1, two: 2 } end - it "does not copy when calling a method taking a positional Hash" do - def m(h) - h.delete(:one); h - end + ruby_bug "#20012", ""..."3.3" do + it "makes a copy when calling a method taking a positional Hash" do + def m(h) + h.delete(:one); h + end - h = { one: 1, two: 2 } - m(**h).should == { two: 2 } - m(**h).should.equal?(h) - h.should == { two: 2 } + h = { one: 1, two: 2 } + m(**h).should == { two: 2 } + m(**h).should_not.equal?(h) + h.should == { one: 1, two: 2 } + end end ruby_version_is "3.1" do diff --git a/spec/ruby/language/keyword_arguments_spec.rb b/spec/ruby/language/keyword_arguments_spec.rb index e2c816f622..ffb5b1fab0 100644 --- a/spec/ruby/language/keyword_arguments_spec.rb +++ b/spec/ruby/language/keyword_arguments_spec.rb @@ -87,13 +87,16 @@ describe "Keyword arguments" do end context "**" do - it "does not copy a non-empty Hash for a method taking (*args)" do - def m(*args) - args[0] - end + ruby_version_is "3.3" do + it "copies a non-empty Hash for a method taking (*args)" do + def m(*args) + args[0] + end - h = {a: 1} - m(**h).should.equal?(h) + h = {a: 1} + m(**h).should_not.equal?(h) + h.should == {a: 1} + end end it "copies the given Hash for a method taking (**kwargs)" do |