Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

specs for mirror config

  • Loading branch information...
commit 06073a41637f54b8e1502603498cf66809bf9e82 1 parent 7f1f861
Christian Meier authored

Showing 1 changed file with 37 additions and 0 deletions. Show diff stats Hide diff stats

  1. +37 0 spec/install/gems/simple_case_spec.rb
37 spec/install/gems/simple_case_spec.rb
... ... @@ -1,6 +1,43 @@
1 1 require "spec_helper"
2 2
3 3 describe "bundle install with gem sources" do
  4 + describe "with mirror settings" do
  5 +
  6 + it 'configures mirrors' do
  7 + config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "file://repo1/",
  8 + "BUNDLE_MIRROR__HTTP://RUBYGEMS.ORG/" => "file://repo2",
  9 + "BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG/" => "file://repo3/",
  10 + "BUNDLE_MIRROR__HTTP://RUBYGEMS.ORG" => "file://repo4")
  11 +
  12 + gemfile # Bundler.settings needs a Gemfile
  13 +
  14 + expect(Bundler::RubygemsMirror.to_uri('http://rubygems.org').to_s).to eq('file://repo4/')
  15 + expect(Bundler::RubygemsMirror.to_uri('https://rubygems.org/').to_s).to eq('file://repo3/')
  16 + end
  17 +
  18 + it "creates a Gemfile.lock" do
  19 + config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "file://#{gem_repo1}/")
  20 + install_gemfile <<-G
  21 + source 'https://rubygems.org'
  22 + gem "rack"
  23 + G
  24 +
  25 + expect(bundled_app('Gemfile.lock')).to exist
  26 + end
  27 +
  28 + it "should fail with wrong mirror" do
  29 + config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "file://me.and.the.corner")
  30 + install_gemfile <<-G, :expect_err => true
  31 + source 'https://rubygems.org'
  32 + gem "rack"
  33 + G
  34 +
  35 + expect(out).to match(/Could not fetch specs from file:\/\/me.and.the.corner/)
  36 + expect(bundled_app('Gemfile.lock')).to_not exist
  37 + end
  38 +
  39 + end
  40 +
4 41 describe "the simple case" do
5 42 it "prints output and returns if no dependencies are specified" do
6 43 gemfile <<-G

0 comments on commit 06073a4

Please sign in to comment.
Something went wrong with that request. Please try again.