summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-02-02 12:04:11 +0100
committerBenoit Daloze <eregontp@gmail.com>2019-02-02 12:05:36 +0100
commit93f6e63472533bd385e350f2998586353e896940 (patch)
tree60e16d518f21d40f15e26f4b425f6c2a080addb9
parentf685f77d3cd52cf517d9760002b279c8db5e89ff (diff)
downloadffi-93f6e63472533bd385e350f2998586353e896940.tar.gz
Require ffi, not just ffi/platform as that is problematic
* The C extension defines FFI::Platform::CPU
-rw-r--r--spec/ffi/fixtures/compile.rb3
-rw-r--r--spec/ffi/spec_helper.rb6
2 files changed, 2 insertions, 7 deletions
diff --git a/spec/ffi/fixtures/compile.rb b/spec/ffi/fixtures/compile.rb
index a5b4c5a..77a58b2 100644
--- a/spec/ffi/fixtures/compile.rb
+++ b/spec/ffi/fixtures/compile.rb
@@ -5,6 +5,7 @@
require 'rbconfig'
require 'fileutils'
+require 'ffi'
CPU = case RbConfig::CONFIG['host_cpu'].downcase
when /i[3456]86/
@@ -62,8 +63,6 @@ def compile_library(path, lib)
lib
end
-require 'ffi/platform'
-
module TestLibrary
PATH = compile_library(".", "libtest.#{FFI::Platform::LIBSUFFIX}")
end
diff --git a/spec/ffi/spec_helper.rb b/spec/ffi/spec_helper.rb
index 84db07f..69a596e 100644
--- a/spec/ffi/spec_helper.rb
+++ b/spec/ffi/spec_helper.rb
@@ -3,16 +3,12 @@
# For licensing, see LICENSE.SPECS
#
-require 'rbconfig'
-require 'fileutils'
+require_relative 'fixtures/compile'
RSpec.configure do |c|
c.filter_run_excluding :broken => true
end
-require_relative 'fixtures/compile'
-require 'ffi'
-
module TestLibrary
def self.force_gc
if RUBY_PLATFORM =~ /java/