Sha256: f366fbcc7996d53cb767e21dd2378d77fe6cc07c05456abd49f196d1a36c098f

Contents?: true

Size: 1.96 KB

Versions: 53

Compression:

Stored size: 1.96 KB

Contents

require "spec_helper"

describe "bundle install with gem sources" do
  describe "when cached and locked" do
    it "does not hit the remote at all" do
      build_repo2
      install_gemfile <<-G
        source "file://#{gem_repo2}"
        gem "rack"
      G

      bundle :pack
      simulate_new_machine
      FileUtils.rm_rf gem_repo2

      bundle "install --local"
      should_be_installed "rack 1.0.0"
    end

    it "does not hit the remote at all" do
      build_repo2
      install_gemfile <<-G
        source "file://#{gem_repo2}"
        gem "rack"
      G

      bundle :pack
      simulate_new_machine
      FileUtils.rm_rf gem_repo2

      bundle "install --deployment"
      should_be_installed "rack 1.0.0"
    end

    it "does not reinstall already-installed gems" do
      install_gemfile <<-G
        source "file://#{gem_repo1}"
        gem "rack"
      G
      bundle :pack

      build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
        s.write "lib/rack.rb", "raise 'omg'"
      end

      bundle :install
      err.should be_empty
      should_be_installed "rack 1.0"
    end

    it "ignores cached gems for the wrong platform" do
      simulate_platform "java" do
        install_gemfile <<-G
          source "file://#{gem_repo1}"
          gem "platform_specific"
        G
        bundle :pack
      end

      simulate_new_machine

      simulate_platform "ruby" do
        install_gemfile <<-G
          source "file://#{gem_repo1}"
          gem "platform_specific"
        G
        run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
        out.should == "1.0.0 RUBY"
      end
    end

    it "does not update the cache if --no-cache is passed" do
      gemfile <<-G
        source "file://#{gem_repo1}"
        gem "rack"
      G
      bundled_app("vendor/cache").mkpath
      bundled_app("vendor/cache").children.should be_empty

      bundle "install --no-cache"
      bundled_app("vendor/cache").children.should be_empty
    end
  end
end

Version data entries

53 entries across 53 versions & 5 rubygems

Version Path
bundler-1.2.5 spec/install/gems/packed_spec.rb
bundler-1.2.4 spec/install/gems/packed_spec.rb
bundler-1.2.3 spec/install/gems/packed_spec.rb
bundler-1.2.2 spec/install/gems/packed_spec.rb
bundler-1.2.1 spec/install/gems/packed_spec.rb
bundler-1.2.0 spec/install/gems/packed_spec.rb
bundler-1.2.0.rc.2 spec/install/gems/packed_spec.rb
bundler-1.2.0.rc spec/install/gems/packed_spec.rb
bundler-1.1.5 spec/install/gems/packed_spec.rb
bundler-1.2.0.pre.1 spec/install/gems/packed_spec.rb
bundler-1.1.4 spec/install/gems/packed_spec.rb
rkh-bundler-1.2.0.pre spec/install/gems/packed_spec.rb
bundler-1.2.0.pre spec/install/gems/packed_spec.rb
bundler-1.1.3 spec/install/gems/packed_spec.rb
bundler-1.1.2 spec/install/gems/packed_spec.rb
bundler-1.1.1 spec/install/gems/packed_spec.rb
bundler-1.1.0 spec/install/gems/packed_spec.rb
bundler-1.1.rc.8 spec/install/gems/packed_spec.rb
bundler-1.0.22 spec/install/gems/packed_spec.rb
bundler-1.1.rc.7 spec/install/gems/packed_spec.rb