Sha256: f90107b3d41fdd88e5e0fe57f4ec342d76736e7b30d632736e014efa8b73cab8

Contents?: true

Size: 1.7 KB

Versions: 42

Compression:

Stored size: 1.7 KB

Contents

require "spec_helper"

describe "Bundler.setup with multi platform stuff" do
  it "raises a friendly error when gems are missing locally" do
    gemfile <<-G
      source "file://#{gem_repo1}"
      gem "rack"
    G

    lockfile <<-G
      GEM
        remote: file:#{gem_repo1}/
        specs:
          rack (1.0)

      PLATFORMS
        #{local_tag}

      DEPENDENCIES
        rack
    G

    ruby <<-R
      begin
        require 'bundler'
        Bundler.setup
      rescue Bundler::GemNotFound => e
        puts "WIN"
      end
    R

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

  it "will resolve correctly on the current platform when the lockfile was targetted for a different one" do
    lockfile <<-G
      GEM
        remote: file:#{gem_repo1}/
        specs:
          nokogiri (1.4.2-java)
            weakling (= 0.0.3)
          weakling (0.0.3)

      PLATFORMS
        java

      DEPENDENCIES
        nokogiri
    G

    system_gems "nokogiri-1.4.2"

    simulate_platform "x86-darwin-10"
    gemfile <<-G
      source "file://#{gem_repo1}"
      gem "nokogiri"
    G

    should_be_installed "nokogiri 1.4.2"
  end

  it "will add the resolve for the current platform" do
    lockfile <<-G
      GEM
        remote: file:#{gem_repo1}/
        specs:
          nokogiri (1.4.2-java)
            weakling (= 0.0.3)
          weakling (0.0.3)

      PLATFORMS
        java

      DEPENDENCIES
        nokogiri
    G

    simulate_platform "x86-darwin-100"

    system_gems "nokogiri-1.4.2", "platform_specific-1.0-x86-darwin-100"

    gemfile <<-G
      source "file://#{gem_repo1}"
      gem "nokogiri"
      gem "platform_specific"
    G

    should_be_installed "nokogiri 1.4.2", "platform_specific 1.0 x86-darwin-100"
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
bundler-1.7.15 spec/runtime/platform_spec.rb
bundler-1.7.14 spec/runtime/platform_spec.rb
bundler-1.7.13 spec/runtime/platform_spec.rb
bundler-1.7.12 spec/runtime/platform_spec.rb
bundler-1.7.11 spec/runtime/platform_spec.rb
bundler-1.7.10 spec/runtime/platform_spec.rb
bundler-1.7.9 spec/runtime/platform_spec.rb
bundler-1.7.8 spec/runtime/platform_spec.rb
bundler-1.7.7 spec/runtime/platform_spec.rb
bundler-1.7.6 spec/runtime/platform_spec.rb
bundler-1.6.9 spec/runtime/platform_spec.rb
bundler-1.7.5 spec/runtime/platform_spec.rb
bundler-1.6.8 spec/runtime/platform_spec.rb
bundler-1.7.4 spec/runtime/platform_spec.rb
bundler-1.6.7 spec/runtime/platform_spec.rb
bundler-1.7.3 spec/runtime/platform_spec.rb
bundler-1.6.6 spec/runtime/platform_spec.rb
bundler-1.7.2 spec/runtime/platform_spec.rb
bundler-1.7.1 spec/runtime/platform_spec.rb
bundler-1.7.1.pre.3 spec/runtime/platform_spec.rb