Sha256: ae5c0826e01d99489d2c4557a8bb3dc8efe531e96377099ecdddd033fc43f7ab

Contents?: true

Size: 1.9 KB

Versions: 36

Compression:

Stored size: 1.9 KB

Contents

require 'spec_helper'

describe "Gem::Specification#match_platform" do
  it "does not match platforms other than the gem platform" do
    darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
    expect(darwin.match_platform(pl('java'))).to eq(false)
  end
end

describe "Bundler::GemHelpers#generic" do
  include Bundler::GemHelpers

  it "converts non-windows platforms into ruby" do
    expect(generic(pl('x86-darwin-10'))).to eq(pl('ruby'))
    expect(generic(pl('ruby'))).to eq(pl('ruby'))
  end

  it "converts java platform variants into java" do
    expect(generic(pl('universal-java-17'))).to eq(pl('java'))
    expect(generic(pl('java'))).to eq(pl('java'))
  end

  it "converts mswin platform variants into x86-mswin32" do
    expect(generic(pl('mswin32'))).to eq(pl('x86-mswin32'))
    expect(generic(pl('i386-mswin32'))).to eq(pl('x86-mswin32'))
    expect(generic(pl('x86-mswin32'))).to eq(pl('x86-mswin32'))
  end

  it "converts 32-bit mingw platform variants into x86-mingw32" do
    expect(generic(pl('mingw32'))).to eq(pl('x86-mingw32'))
    expect(generic(pl('i386-mingw32'))).to eq(pl('x86-mingw32'))
    expect(generic(pl('x86-mingw32'))).to eq(pl('x86-mingw32'))
  end

  it "converts 64-bit mingw platform variants into x64-mingw32" do
    expect(generic(pl('x64-mingw32'))).to eq(pl('x64-mingw32'))
    expect(generic(pl('x86_64-mingw32'))).to eq(pl('x64-mingw32'))
  end
end

describe "Gem::SourceIndex#refresh!" do
  rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0")

  before do
    install_gemfile <<-G
      source "file://#{gem_repo1}"
      gem "rack"
    G
  end

  it "does not explode when called", :if => rubygems_1_7 do
    run "Gem.source_index.refresh!"
    run "Gem::SourceIndex.new([]).refresh!"
  end

  it "does not explode when called", :unless => rubygems_1_7 do
    run "Gem.source_index.refresh!"
    run "Gem::SourceIndex.from_gems_in([]).refresh!"
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

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