Sha256: c92d12ad1dbd97548c4dc8ce11393b57ba569953cb3157149ea47aa4b87860a0
Contents?: true
Size: 1.19 KB
Versions: 69
Compression:
Stored size: 1.19 KB
Contents
require "spec_helper" describe "installing a gem with C extensions" do it "installs" do build_repo2 do build_gem "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 end gemfile <<-G source "file://#{gem_repo2}" gem "c_extension" G bundle "config build.c_extension --with-c_extension=hello" bundle "install" out.should_not include("extconf.rb failed") run "Bundler.require; puts CExtension.new.its_true" out.should == "true" end end
Version data entries
69 entries across 69 versions & 7 rubygems