Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 6580db2

Browse files
committed
Merge pull request #1875 from rspec/cleanup-args-shifting
Remove unnecessary shift/unshift.
2 parents c096053 + f251894 commit 6580db2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/rspec/core/example_group.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def self.subclass(parent, description, args, &example_group_block)
372372
end
373373

374374
# @private
375-
def self.set_it_up(*args, &example_group_block)
375+
def self.set_it_up(description, *args, &example_group_block)
376376
# Ruby 1.9 has a bug that can lead to infinite recursion and a
377377
# SystemStackError if you include a module in a superclass after
378378
# including it in a subclass: https://gist.github.com/845896
@@ -383,12 +383,10 @@ def self.set_it_up(*args, &example_group_block)
383383
# here.
384384
ensure_example_groups_are_configured
385385

386-
description = args.shift
387386
user_metadata = Metadata.build_hash_from(args)
388-
args.unshift(description)
389387

390388
@metadata = Metadata::ExampleGroupHash.create(
391-
superclass_metadata, user_metadata, *args, &example_group_block
389+
superclass_metadata, user_metadata, description, *args, &example_group_block
392390
)
393391

394392
hooks.register_globals(self, RSpec.configuration.hooks)

0 commit comments

Comments
 (0)