diff options
author | Andre Arko <andre@arko.net> | 2010-11-03 23:23:51 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-11-03 23:23:51 -0700 |
commit | b794e2d8c181d68b331448dd80a48152ec608d29 (patch) | |
tree | c00e4304af3566d0514744db42e76105e2f31f75 /spec/support/fakeweb | |
parent | f99e2cadb31d9cec7f504e9209f617d4af342ab7 (diff) | |
download | bundler-b794e2d8c181d68b331448dd80a48152ec608d29.tar.gz |
Fakeweb extraction into helper
Diffstat (limited to 'spec/support/fakeweb')
-rw-r--r-- | spec/support/fakeweb/windows.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/support/fakeweb/windows.rb b/spec/support/fakeweb/windows.rb new file mode 100644 index 0000000000..b015e63970 --- /dev/null +++ b/spec/support/fakeweb/windows.rb @@ -0,0 +1,23 @@ +require File.expand_path("../../path.rb", __FILE__) +include Spec::Path + +files = [ 'specs.4.8.gz', + 'prerelease_specs.4.8.gz', + 'quick/Marshal.4.8/rcov-1.0-mswin32.gemspec.rz', + 'gems/rcov-1.0-mswin32.gem' ] + +# Set up pretend http gem server with FakeWeb +$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/fakeweb*/lib")].first}" +require 'fakeweb' + +FakeWeb.allow_net_connect = false + +files.each do |file| + FakeWeb.register_uri(:get, "http://localgemserver.test/#{file}", + :body => File.read("#{gem_repo1}/#{file}")) +end +FakeWeb.register_uri(:get, "http://localgemserver.test/gems/rcov-1.0-x86-mswin32.gem", + :status => ["404", "Not Found"]) + +FakeWeb.register_uri(:get, "http://localgemserver.test/api/v1/dependencies?gems=rcov", + :status => ["404", "Not Found"]) |