diff options
author | Andre Arko <andre@arko.net> | 2011-04-08 13:47:08 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-04-08 13:47:08 -0700 |
commit | a890c9cd0e41ab0ac97c1f103d9200fc95d3d226 (patch) | |
tree | 8cd2987a61a84d0f2966b567b479dd7295be317a /spec | |
parent | 1e9ec089b4792089cdd4978843750f551c519436 (diff) | |
download | bundler-a890c9cd0e41ab0ac97c1f103d9200fc95d3d226.tar.gz |
fix Gem::SourceIndex.refresh! on Rubygems 1.7 and up
Diffstat (limited to 'spec')
-rw-r--r-- | spec/other/ext_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/other/ext_spec.rb b/spec/other/ext_spec.rb index 2dd6afc9..ff6864ef 100644 --- a/spec/other/ext_spec.rb +++ b/spec/other/ext_spec.rb @@ -14,3 +14,24 @@ describe "Bundler::GemHelpers#generic" do generic(pl('x86-darwin-10')).should == pl('ruby') 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
\ No newline at end of file |