From 14d517ededb62dd134ecbfa6a91b227be8a15e8d Mon Sep 17 00:00:00 2001 From: Eisuke Yoshida Date: Tue, 5 Mar 2024 23:17:32 +0900 Subject: [PATCH] Update: only if a first argument of example is String obejct, example recognize it as description --- lib/rspec/core/example_group.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb index a434f07601..2f353a93c5 100644 --- a/lib/rspec/core/example_group.rb +++ b/lib/rspec/core/example_group.rb @@ -144,7 +144,8 @@ def described_class # def self.define_example_method(name, extra_options={}) idempotently_define_singleton_method(name) do |*all_args, &block| - desc, *args = *all_args + desc = all_args.shift if all_args.first.is_a? String + args = all_args options = Metadata.build_hash_from(args) options.update(:skip => RSpec::Core::Pending::NOT_YET_IMPLEMENTED) unless block