summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2009-07-23 16:46:36 -0700
committerCarl Lerche <carllerche@mac.com>2009-07-23 16:46:36 -0700
commit01e41884bcaaf26fc3d10bc82737991aed8b60c1 (patch)
treebb369aae7e61fea59f9ba2216814a23bbd4c209e
parent95535f3d57fa8c4ff5f468e9f0e04b970cfae4e1 (diff)
downloadbundler-01e41884bcaaf26fc3d10bc82737991aed8b60c1.tar.gz
Added some specs to test specifying the manifest file as an option
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/bundler/cli_spec.rb28
-rw-r--r--spec/spec_helper.rb1
3 files changed, 30 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 5492bb58c0..ffb2d15f96 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -36,7 +36,7 @@ module Bundler
op.banner = "Usage: gem_bundler [OPTIONS] [PATH]"
op.on("-m", "--manifest MANIFEST") do |manifest|
- @manifest = manifest
+ @manifest = Pathname.new(manifest)
end
op.on_tail("-h", "--help", "Show this message") do
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 963042605e..dabd24a8d1 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -61,6 +61,34 @@ describe "Bundler::CLI" do
end
end
+ describe "it working while specifying the manifest file name" do
+ it "works when the manifest is in the root directory" do
+ build_manifest_file tmp_file('manifest.rb'), <<-Gemfile
+ bundle_path "gems"
+ sources.clear
+ source "file://#{gem_repo1}"
+ gem "rake"
+ Gemfile
+
+ Dir.chdir(tmp_file)
+ Bundler::CLI.run(["-m", tmp_file('manifest.rb').to_s])
+ tmp_file("gems").should have_cached_gems("rake-0.8.7")
+ end
+
+ it "works when the manifest is in a different directory" do
+ build_manifest_file tmp_file('config', 'manifest.rb'), <<-Gemfile
+ bundle_path "../gems"
+ sources.clear
+ source "file://#{gem_repo1}"
+ gem "rake"
+ Gemfile
+
+ Dir.chdir(tmp_file)
+ Bundler::CLI.run(["-m", tmp_file('config', 'manifest.rb').to_s])
+ tmp_file("gems").should have_cached_gems("rake-0.8.7")
+ end
+ end
+
describe "it working without rubygems" do
before(:each) do
build_manifest <<-Gemfile
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 547d4cc14c..902900ff48 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -56,6 +56,7 @@ module Spec
path = tmp_file("Gemfile")
path = args.shift if args.first.is_a?(Pathname)
str = args.shift || ""
+ FileUtils.mkdir_p(path.dirname)
File.open(path, 'w') do |f|
f.puts str
end