Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Test the CLI Happy Path

  • Loading branch information...
commit 5928cfaf93a3386ff2b6bfdda5a189e4a4834282 1 parent 5906ec2
Yehuda Katz + Carl Lerche authored
4 bin/gem_bundler
@@ -18,9 +18,9 @@ parser = OptionParser.new do |op|
18 18 end
19 19 parser.parse!
20 20
21   -options[:path] = ARGV.shift || File.join(Dir.pwd, "vendor", "gems")
  21 +options[:path] = ARGV.shift || Bundler::CLI.default_path
22 22
23   -options[:manifest] ||= "Gemfile"
  23 +options[:manifest] ||= Bundler::CLI.default_manifest
24 24
25 25 unless File.exist?(options[:manifest])
26 26 puts parser
4 lib/bundler/manifest.rb
@@ -68,8 +68,8 @@ def all_gems_installed?
68 68 gem_versions[name] = Gem::Version.new(version)
69 69 end
70 70
71   - ret = gem_dependencies.all? do |dep|
72   - # gem_versions[dep.name] &&
  71 + gem_dependencies.all? do |dep|
  72 + gem_versions[dep.name] &&
73 73 dep.version_requirements.satisfied_by?(gem_versions[dep.name])
74 74 end
75 75 end
24 spec/bundler/cli_spec.rb
@@ -39,4 +39,28 @@
39 39 @cli.default_path.should == tmp_file("vendor", "gems").to_s
40 40 end
41 41
  42 + it "works" do
  43 + File.open(tmp_file("Gemfile"), 'w') do |file|
  44 + file.puts <<-DSL
  45 + sources.clear
  46 + source "file://#{gem_repo1}"
  47 + gem "rake"
  48 + DSL
  49 + end
  50 +
  51 + lib = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
  52 + bin = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'gem_bundler'))
  53 +
  54 + Dir.chdir(tmp_dir) do
  55 + `#{Gem.ruby} -I #{lib} #{bin}`
  56 + end
  57 +
  58 + tmp_file("vendor", "gems").should have_cached_gems("rake-0.8.7")
  59 + tmp_file("vendor", "gems").should have_installed_gems("rake-0.8.7")
  60 +
  61 + tmp_file('vendor', 'gems', 'environments', 'default.rb').should have_load_paths(tmp_file("vendor", "gems"),
  62 + "rake-0.8.7" => %w(bin lib)
  63 + )
  64 + end
  65 +
42 66 end

0 comments on commit 5928cfa

Please sign in to comment.
Something went wrong with that request. Please try again.