From e63ecb909efa6ff9c4172e3f36e4ff8ac80ddb3a Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sat, 12 Feb 2022 22:31:36 +0900 Subject: [PATCH] Handle rspec-mocks 3.10.3 change with "with" syntax rspec-mocks 3.10.3 changed "with" syntax behavior to support ruby 3 keyword arguments separation: https://github.com/rspec/rspec-mocks/pull/1394 https://github.com/rspec/rspec-mocks/issues/1460 Fix yard testsuite accordingly. Fixes #1432 --- Gemfile | 2 +- spec/code_objects/base_spec.rb | 2 +- spec/templates/helpers/base_helper_spec.rb | 2 +- spec/templates/template_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index ffea136d0..39581d31e 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' group :development do - gem 'rspec' + gem 'rspec', '>= 3.11.0' gem 'rake' gem 'rdoc' gem 'json' diff --git a/spec/code_objects/base_spec.rb b/spec/code_objects/base_spec.rb index f0820c480..4e766c440 100644 --- a/spec/code_objects/base_spec.rb +++ b/spec/code_objects/base_spec.rb @@ -249,7 +249,7 @@ class X; end describe "#format" do it "sends object to Templates.render" do object = MethodObject.new(:root, :method) - expect(Templates::Engine).to receive(:render).with(:x => 1, :object => object, :type => object.type) + expect(Templates::Engine).to receive(:render).with({:x => 1, :object => object, :type => object.type}) object.format :x => 1 end diff --git a/spec/templates/helpers/base_helper_spec.rb b/spec/templates/helpers/base_helper_spec.rb index 68937318c..fc2cd3863 100644 --- a/spec/templates/helpers/base_helper_spec.rb +++ b/spec/templates/helpers/base_helper_spec.rb @@ -97,7 +97,7 @@ it "passes off to #link_url if argument is recognized as a URL" do url = "http://yardoc.org/" - expect(self).to receive(:link_url).with(url, nil, :target => '_parent') + expect(self).to receive(:link_url).with(url, nil, {:target => '_parent'}) linkify url end diff --git a/spec/templates/template_spec.rb b/spec/templates/template_spec.rb index ab0e7ede1..21808cc24 100644 --- a/spec/templates/template_spec.rb +++ b/spec/templates/template_spec.rb @@ -208,7 +208,7 @@ def init; sections 1, 2, 3 end it "renders all sections with options" do mod = template(:e).new allow(mod).to receive(:render_section) {|section| section.name.to_s } - expect(mod).to receive(:add_options).with(:a => 1).and_yield + expect(mod).to receive(:add_options).with({:a => 1}).and_yield mod.sections :a expect(mod.run(:a => 1)).to eq 'a' end