Skip to content

Commit d40140b

Browse files
y-yagiwasifhossain
authored andcommitted
Fix checking of method defined or not
The `Module#method_defined?` works for an instance method. But `with_unbundled_env` defines as a class method. Therefore, the current check doesn't work as expected. ```ruby require "bundler" puts Bundler.method_defined?(:with_unbundled_env) # => false puts Bundler.respond_to?(:with_unbundled_env) # => true ``` This fixes the following message that shows when running a test. ``` [DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env` (called at /home/y-yagi/src/github.com/rails-api/active_model_serializers/Rakefile:68) ```
1 parent 524aeef commit d40140b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace :test do
6060
end or fail 'Failures' # rubocop:disable Style/AndOr
6161
end
6262
bundler_method =
63-
if Bundler.method_defined?(:with_unbundled_env)
63+
if Bundler.respond_to?(:with_unbundled_env)
6464
:with_unbundled_env
6565
else
6666
:with_clean_env

0 commit comments

Comments
 (0)