Sha256: 78541a3d6f4445dbf89977f6f60462ec53850f88d4f6574bf08d9e857b6333de

Contents?: true

Size: 1.2 KB

Versions: 60

Compression:

Stored size: 1.2 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"

    expect(out).not_to include("extconf.rb failed")

    run "Bundler.require; puts CExtension.new.its_true"
    expect(out).to eq("true")
  end
end

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
bundler-1.7.15 spec/install/gems/c_ext_spec.rb
bundler-1.7.14 spec/install/gems/c_ext_spec.rb
bundler-1.7.13 spec/install/gems/c_ext_spec.rb
bundler-1.7.12 spec/install/gems/c_ext_spec.rb
bundler-1.7.11 spec/install/gems/c_ext_spec.rb
bundler-1.7.10 spec/install/gems/c_ext_spec.rb
bundler-1.7.9 spec/install/gems/c_ext_spec.rb
bundler-1.7.8 spec/install/gems/c_ext_spec.rb
bundler-1.7.7 spec/install/gems/c_ext_spec.rb
bundler-1.7.6 spec/install/gems/c_ext_spec.rb
bundler-1.6.9 spec/install/gems/c_ext_spec.rb
bundler-1.7.5 spec/install/gems/c_ext_spec.rb
bundler-1.6.8 spec/install/gems/c_ext_spec.rb
bundler-1.7.4 spec/install/gems/c_ext_spec.rb
bundler-1.6.7 spec/install/gems/c_ext_spec.rb
bundler-1.7.3 spec/install/gems/c_ext_spec.rb
bundler-1.6.6 spec/install/gems/c_ext_spec.rb
bundler-1.7.2 spec/install/gems/c_ext_spec.rb
bundler-1.7.1 spec/install/gems/c_ext_spec.rb
bundler-1.7.1.pre.3 spec/install/gems/c_ext_spec.rb