summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-08-08 11:14:20 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-08-08 11:14:20 -0500
commitc68e2db53ab8412ae7334ac74dc5fd7783f6fd3a (patch)
treece5cf7c84121cac9465917e49d8b535afe311186
parent54a81ed3f58108ecbb6bf0c4945e1d4316e04f85 (diff)
downloadbundler-seg-offline-new-index.tar.gz
Fix network fail simulation on Ruby < 2.0seg-offline-new-index
-rw-r--r--spec/support/artifice/fail.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/artifice/fail.rb b/spec/support/artifice/fail.rb
index 9443d953e1..e15768a328 100644
--- a/spec/support/artifice/fail.rb
+++ b/spec/support/artifice/fail.rb
@@ -15,7 +15,9 @@ class Fail
end
def exception(env)
- Object.const_get(ENV.fetch("BUNDLER_SPEC_EXCEPTION") { "Errno::ENETUNREACH" }).new("host down: Bundler spec artifice fail! #{env["PATH_INFO"]}")
+ name = ENV.fetch("BUNDLER_SPEC_EXCEPTION") { "Errno::ENETUNREACH" }
+ const = name.split("::").reduce(Object) {|mod, sym| mod.const_get(sym) }
+ const.new("host down: Bundler spec artifice fail! #{env["PATH_INFO"]}")
end
end
Artifice.activate_with(Fail.new)