summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-03 01:08:50 -0700
committerAndre Arko <andre@arko.net>2010-04-03 01:08:50 -0700
commit00fd2be0a624a4bdadd0a17d5172969ef3f11884 (patch)
tree853957c54a120bc2acea6c6ee8e42a51d014b2a9
parentf69931f12d20a089caba6574d9a9224f8092d2a0 (diff)
downloadbundler-00fd2be0a624a4bdadd0a17d5172969ef3f11884.tar.gz
Attempted spec for long-name tar error. Passes, though.
-rw-r--r--spec/install/git_spec.rb20
-rw-r--r--spec/support/builders.rb40
2 files changed, 42 insertions, 18 deletions
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index 264c539f50..2dfc8ef7af 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -284,4 +284,24 @@ describe "bundle install with git sources" do
out.should match(/could not find gem 'foo/i)
out.should match(/run `bundle install`/i)
end
+
+ it "handles long gem names and full shas with C extensions" do
+ build_git "some_gem_with_a_really_stupidly_long_name_argh" do |s|
+ s.executables = "stupid"
+ s.add_c_extension
+ end
+ sha = revision_for(lib_path("some_gem_with_a_really_stupidly_long_name_argh-1.0"))
+ install_gemfile <<-G
+ gem "some_gem_with_a_really_stupidly_long_name_argh",
+ :git => "#{lib_path("some_gem_with_a_really_stupidly_long_name_argh-1.0")}",
+ :ref => "#{sha}"
+ G
+ should_be_installed "some_gem_with_a_really_stupidly_long_name_argh 1.0"
+
+ bundle "show some_gem_with_a_really_stupidly_long_name_argh"
+ puts out
+
+ bundle "exec stupid"
+ out.should == "1.0"
+ end
end
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index 2a3b530400..4e81c70cca 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -114,24 +114,7 @@ module Spec
end
build_gem "very_simple_binary" do |s|
- s.require_paths << 'ext'
- s.extensions << "ext/extconf.rb"
- s.write "ext/extconf.rb", <<-RUBY
- require "mkmf"
-
- exit 1 unless with_config("simple")
-
- extension_name = "very_simple_binary_c"
- dir_config extension_name
- create_makefile extension_name
- RUBY
- s.write "ext/very_simple_binary.c", <<-C
- #include "ruby.h"
-
- void Init_very_simple_binary_c() {
- rb_define_module("VerySimpleBinaryInC");
- }
- C
+ s.add_c_extension
end
build_gem "bundler", "0.8.1" do |s|
@@ -334,6 +317,27 @@ module Spec
@spec.executables = Array(val)
end
+ def add_c_extension
+ require_paths << 'ext'
+ extensions << "ext/extconf.rb"
+ write "ext/extconf.rb", <<-RUBY
+ require "mkmf"
+
+ # exit 1 unless with_config("simple")
+
+ extension_name = "very_simple_binary_c"
+ dir_config extension_name
+ create_makefile extension_name
+ RUBY
+ write "ext/very_simple_binary.c", <<-C
+ #include "ruby.h"
+
+ void Init_very_simple_binary_c() {
+ rb_define_module("VerySimpleBinaryInC");
+ }
+ C
+ end
+
def _build(options)
path = options[:path] || _default_path
@files["#{name}.gemspec"] = @spec.to_ruby unless options[:gemspec] == false