diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-02-07 18:46:23 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-02-07 19:02:09 -0600 |
commit | 66b7c904bcdd257f045e40ac40c636dea105ea68 (patch) | |
tree | b7b7023ab6105f1707ec254f4f371cf6ff1d13a3 /spec/install | |
parent | c0de8f625f0ae2ed5cc2b26673c875e2900a9829 (diff) | |
download | bundler-66b7c904bcdd257f045e40ac40c636dea105ea68.tar.gz |
Properly set native extension build args for git gemsseg-git-build-args
Diffstat (limited to 'spec/install')
-rw-r--r-- | spec/install/gems/native_extensions_spec.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/install/gems/native_extensions_spec.rb b/spec/install/gems/native_extensions_spec.rb index 3b146495ed..7531768b5f 100644 --- a/spec/install/gems/native_extensions_spec.rb +++ b/spec/install/gems/native_extensions_spec.rb @@ -47,4 +47,46 @@ RSpec.describe "installing a gem with native extensions" do run "Bundler.require; puts CExtension.new.its_true" expect(out).to eq("true") end + + it "installs from git" do + build_git "c_extension" do |s| + s.extensions = ["ext/extconf.rb"] + s.write "ext/extconf.rb", <<-E + require "mkmf" + name = "c_extension_bundle" + dir_config(name) + raise "OMG" unless with_config("c_extension") == "hello" + create_makefile(name) + E + + s.write "ext/c_extension.c", <<-C + #include "ruby.h" + + VALUE c_extension_true(VALUE self) { + return Qtrue; + } + + void Init_c_extension_bundle() { + VALUE c_Extension = rb_define_class("CExtension", rb_cObject); + rb_define_method(c_Extension, "its_true", c_extension_true, 0); + } + C + + s.write "lib/c_extension.rb", <<-C + require "c_extension_bundle" + C + end + + bundle! "config build.c_extension --with-c_extension=hello" + + install_gemfile! <<-G + gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump} + G + + expect(out).not_to include("extconf.rb failed") + expect(out).to include("Using c_extension 1.0") + + run! "Bundler.require; puts CExtension.new.its_true" + expect(out).to eq("true") + end end |