Skip to content

Commit d04a66e

Browse files
committed
make jruby happy
1 parent c267987 commit d04a66e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

spec/support/core_helpers.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,19 @@ def skip_unless_integration_testing_enabled
7575
# work on Ruby 2.5/2.6 and 2.7+. In practice only one type of arguments
7676
# should be used in any given call.
7777
def with_env(*args, **opts)
78+
if args.any? && opts.any?
79+
raise ArgumentError, 'Do not pass both args and opts'
80+
end
81+
7882
around do |example|
79-
ClimateControl.modify(*args, **opts) do
80-
example.run
83+
if args.any?
84+
ClimateControl.modify(*args) do
85+
example.run
86+
end
87+
else
88+
ClimateControl.modify(**opts) do
89+
example.run
90+
end
8191
end
8292
end
8393
end

0 commit comments

Comments
 (0)