summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2009-12-09 15:01:38 -0800
committerCarlhuda <carlhuda@engineyard.com>2009-12-09 15:01:38 -0800
commit327af9c55c8dbf9b3e0ee280446d083a3279b393 (patch)
tree61b8a1991b94c461ae06d9070de426f0cbd82c8a /spec
parentd7941860b9cfd6087b0e97eea01e9ddb5b44b895 (diff)
downloadbundler-327af9c55c8dbf9b3e0ee280446d083a3279b393.tar.gz
Bring back ryan davis spermy operators for git & directory sources. Closes #114
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/directory_spec.rb22
-rw-r--r--spec/bundler/git_spec.rb12
2 files changed, 34 insertions, 0 deletions
diff --git a/spec/bundler/directory_spec.rb b/spec/bundler/directory_spec.rb
index 2f3f4ad443..e78b85ed66 100644
--- a/spec/bundler/directory_spec.rb
+++ b/spec/bundler/directory_spec.rb
@@ -164,6 +164,28 @@ describe "Faking gems with directories" do
:default.should have_const("HI2U")
end
+ it "directory can specify spermy specifiers" do
+ build_lib "omg", "1.0.2", :gemspec => true
+
+ install_manifest <<-Gemfile
+ clear_sources
+ gem "omg", "~> 1.0.0", :path => "#{tmp_path}/libs"
+ Gemfile
+
+ :default.should have_const("OMG")
+ end
+
+ it "raises exception when directory does not contain correct gem version" do
+ build_lib "omg", "1.0.2", :gemspec => true
+
+ lambda do
+ install_manifest <<-Gemfile
+ clear_sources
+ gem "omg", "~> 1.1", :path => "#{tmp_path}/libs"
+ Gemfile
+ end.should raise_error(Bundler::GemNotFound, /directory/)
+ end
+
it "can list vendored gems without :path" do
build_lib "omg", "1.0"
install_manifest <<-Gemfile
diff --git a/spec/bundler/git_spec.rb b/spec/bundler/git_spec.rb
index 1cb59d5ba3..21a2d9e91e 100644
--- a/spec/bundler/git_spec.rb
+++ b/spec/bundler/git_spec.rb
@@ -99,6 +99,18 @@ describe "Getting gems from git" do
out.should == "1.0\n1.0"
end
+ it "raises exception when git does not contain correct gem version" do
+ build_lib "omg", "1.0.2", :gemspec => true
+ gitify tmp_path("libs")
+
+ lambda do
+ install_manifest <<-Gemfile
+ clear_sources
+ gem "omg", "~> 1.1", :git => "#{tmp_path("libs")}"
+ Gemfile
+ end.should raise_error(Bundler::GemNotFound, /git/)
+ end
+
it "allows bundling a specific tag" do
path = build_git_repo "very-simple", :with => fixture_dir.join("very-simple")
install_manifest <<-Gemfile