Skip to content
Browse files

Attempted spec for long-name tar error. Passes, though.

  • Loading branch information...
1 parent f69931f commit 00fd2be0a624a4bdadd0a17d5172969ef3f11884 @indirect indirect committed
Showing with 42 additions and 18 deletions.
  1. +20 −0 spec/install/git_spec.rb
  2. +22 −18 spec/support/builders.rb
View
20 spec/install/git_spec.rb
@@ -284,4 +284,24 @@
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
View
40 spec/support/builders.rb
@@ -114,24 +114,7 @@ def build_repo1
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 @@ def executables=(val)
@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

0 comments on commit 00fd2be

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