Sha256: 42f9986b8c175f38b8617703c96dad14a9b8fc75559a98be68ddd931b1fd0eb3

Contents?: true

Size: 1.57 KB

Versions: 17

Compression:

Stored size: 1.57 KB

Contents

require "spec_helper"

describe "bundle update --source" do
  describe "git sources" do
    before :each do
      build_repo2
      @git = build_git "foo", :path => lib_path("foo") do |s|
        s.executables = "foobar"
      end

      install_gemfile <<-G
        source "file://#{gem_repo2}"
        git "#{lib_path('foo')}" do
          gem 'foo'
        end
        gem 'rack'
      G
    end

    it "updates the source" do
      update_git "foo", :path => @git.path

      bundle "update --source foo"

      in_app_root do
        run <<-RUBY
          require 'foo'
          puts "WIN" if defined?(FOO_PREV_REF)
        RUBY

        expect(out).to eq("WIN")
      end
    end

    it "unlocks gems that were originally pulled in by the source" do
      update_git "foo", "2.0", :path => @git.path

      bundle "update --source foo"
      should_be_installed "foo 2.0"
    end

    it "leaves all other gems frozen" do
      update_repo2
      update_git "foo", :path => @git.path

      bundle "update --source foo"
      should_be_installed "rack 1.0"
    end

    it "shows the previous version of the gem when updated from path source" do
      build_lib "activesupport", "2.3.5", :path => lib_path("rails/activesupport")

      install_gemfile <<-G
      gem "activesupport", :path => "#{lib_path('rails/activesupport')}"
      G

      build_lib "activesupport", "3.0", :path => lib_path("rails/activesupport")

      bundle "update --source activesupport"
      expect(out).to include("Using activesupport 3.0 (was 2.3.5) from source at #{lib_path('rails/activesupport')}")
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
bundler-1.6.9 spec/update/source_spec.rb
bundler-1.6.8 spec/update/source_spec.rb
bundler-1.6.7 spec/update/source_spec.rb
bundler-1.6.6 spec/update/source_spec.rb
bundler-1.6.5 spec/update/source_spec.rb
bundler-1.6.4 spec/update/source_spec.rb
bundler-prehistoric-1.6.2.2 spec/update/source_spec.rb
bundler-1.6.3 spec/update/source_spec.rb
bundler-prehistoric-1.6.2.1 spec/update/source_spec.rb
bundler-prehistoric-1.6.2 spec/update/source_spec.rb
bundler-1.6.2 spec/update/source_spec.rb
bundler-1.6.1 spec/update/source_spec.rb
bundler-1.6.0 spec/update/source_spec.rb
bundler-1.6.0.rc2 spec/update/source_spec.rb
bundler-1.6.0.rc spec/update/source_spec.rb
bundler-1.6.0.pre.2 spec/update/source_spec.rb
bundler-1.6.0.pre.1 spec/update/source_spec.rb