aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/artifice/endpoint_creds_diff_host.rb7
-rw-r--r--spec/support/helpers.rb30
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