summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/support/artifice/endpoint.rb7
-rw-r--r--spec/support/artifice/endpoint_500.rb6
-rw-r--r--spec/support/artifice/fail.rb5
-rw-r--r--spec/support/rubygems_ext.rb2
4 files changed, 4 insertions, 16 deletions
diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb
index fae72ea4cd..861ac49e93 100644
--- a/spec/support/artifice/endpoint.rb
+++ b/spec/support/artifice/endpoint.rb
@@ -3,12 +3,7 @@ require File.expand_path("../../path.rb", __FILE__)
require File.expand_path("../../../../lib/bundler/deprecate", __FILE__)
include Spec::Path
-# Set up pretend http gem server with Artifice
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/artifice*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].last}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/tilt*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/sinatra*/lib")].first}"
+$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,rack,tilt,sinatra}-*/lib")].map(&:to_s))
require "artifice"
require "sinatra/base"
diff --git a/spec/support/artifice/endpoint_500.rb b/spec/support/artifice/endpoint_500.rb
index 9bbbd1e2f2..993630b79e 100644
--- a/spec/support/artifice/endpoint_500.rb
+++ b/spec/support/artifice/endpoint_500.rb
@@ -2,11 +2,7 @@
require File.expand_path("../../path.rb", __FILE__)
include Spec::Path
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/artifice*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].last}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/tilt*/lib")].first}"
-$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/sinatra*/lib")].first}"
+$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,rack,tilt,sinatra}-*/lib")].map(&:to_s))
require "artifice"
require "sinatra/base"
diff --git a/spec/support/artifice/fail.rb b/spec/support/artifice/fail.rb
index 2e29c03c5b..2ef009c7c8 100644
--- a/spec/support/artifice/fail.rb
+++ b/spec/support/artifice/fail.rb
@@ -3,10 +3,7 @@
require File.expand_path("../../path.rb", __FILE__)
# Set up pretend http gem server with Artifice
-$LOAD_PATH.unshift Dir[Spec::Path.base_system_gems.join("gems/artifice*/lib")].first.to_s
-$LOAD_PATH.unshift Dir[Spec::Path.base_system_gems.join("gems/rack-*/lib")].first.to_s
-$LOAD_PATH.unshift Dir[Spec::Path.base_system_gems.join("gems/rack-*/lib")].last.to_s
-$LOAD_PATH.unshift Dir[Spec::Path.base_system_gems.join("gems/tilt*/lib")].first.to_s
+$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,rack,tilt}-*/lib")].map(&:to_s))
require "artifice"
class Fail
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index f20e051d1d..bb8b7f2a51 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -11,7 +11,7 @@ module Spec
"rack" => "< 2",
"artifice" => "~> 0.6.0",
"compact_index" => "~> 0.11.0",
- "sinatra" => "1.2.7",
+ "sinatra" => "~> 1.4.7",
# Rake version has to be consistent for tests to pass
"rake" => "10.0.2",
# 3.0.0 breaks 1.9.2 specs