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

Version Path
bundler-1.2.5 spec/install/gems/c_ext_spec.rb
bundler-1.2.4 spec/install/gems/c_ext_spec.rb
bundler-1.2.3 spec/install/gems/c_ext_spec.rb
bundler-1.2.2 spec/install/gems/c_ext_spec.rb
bundler-1.2.1 spec/install/gems/c_ext_spec.rb
bundler-1.2.0 spec/install/gems/c_ext_spec.rb
bundler-1.2.0.rc.2 spec/install/gems/c_ext_spec.rb
bundler-1.2.0.rc spec/install/gems/c_ext_spec.rb
bundler-1.1.5 spec/install/gems/c_ext_spec.rb
bundler-1.2.0.pre.1 spec/install/gems/c_ext_spec.rb
bundler-1.1.4 spec/install/gems/c_ext_spec.rb
rkh-bundler-1.2.0.pre spec/install/gems/c_ext_spec.rb
bundler-1.2.0.pre spec/install/gems/c_ext_spec.rb
bundler-1.1.3 spec/install/gems/c_ext_spec.rb
bundler-1.1.2 spec/install/gems/c_ext_spec.rb
bundler-1.1.1 spec/install/gems/c_ext_spec.rb
bundler-1.1.0 spec/install/gems/c_ext_spec.rb
bundler-1.1.rc.8 spec/install/gems/c_ext_spec.rb
bundler-1.0.22 spec/install/gems/c_ext_spec.rb
bundler-1.1.rc.7 spec/install/gems/c_ext_spec.rb