diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-14 16:21:54 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:21:13 -0600 |
commit | e85b990916f16dd9a56dbafae6503f7a48d55131 (patch) | |
tree | f9244f2ab14db6abf5c0bc38ee5508ccfc94aa30 /spec/support | |
parent | 9297bcf0135a0bd8c1df29b929267582ca66217d (diff) | |
download | bundler-e85b990916f16dd9a56dbafae6503f7a48d55131.tar.gz |
[RuboCop] Address Style/GuardClause
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/artifice/endpoint_creds_diff_host.rb | 7 | ||||
-rw-r--r-- | spec/support/helpers.rb | 30 |
2 files changed, 17 insertions, 20 deletions
diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb index 0c10242d..97a81d97 100644 --- a/spec/support/artifice/endpoint_creds_diff_host.rb +++ b/spec/support/artifice/endpoint_creds_diff_host.rb @@ -13,10 +13,9 @@ class EndpointCredsDiffHost < Endpoint end def protected! - unless authorized? - response["WWW-Authenticate"] = %(Basic realm="Testing HTTP Auth") - throw(:halt, [401, "Not authorized\n"]) - end + return if authorized? + response["WWW-Authenticate"] = %(Basic realm="Testing HTTP Auth") + throw(:halt, [401, "Not authorized\n"]) end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 182f7b9b..8aade71a 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -284,14 +284,13 @@ module Spec ENV["GEM_PATH"] = system_gem_path.to_s install_gems(*gems) - if block_given? - begin - yield - ensure - ENV["GEM_HOME"] = gem_home - ENV["GEM_PATH"] = gem_path - ENV["PATH"] = path - end + return unless block_given? + begin + yield + ensure + ENV["GEM_HOME"] = gem_home + ENV["GEM_PATH"] = gem_path + ENV["PATH"] = path end end @@ -312,14 +311,13 @@ module Spec gems.each do |gem| gem_command :install, "--no-rdoc --no-ri #{gem}" end - if block_given? - begin - yield - ensure - ENV["GEM_HOME"] = gem_home - ENV["GEM_PATH"] = gem_path - ENV["PATH"] = path - end + return unless block_given? + begin + yield + ensure + ENV["GEM_HOME"] = gem_home + ENV["GEM_PATH"] = gem_path + ENV["PATH"] = path end end |