Skip to content

Commit 9decd3a

Browse files
committed
spec: Fix ruby execution helper
1 parent cf109ef commit 9decd3a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/support/execute_ruby.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
module PyCall
55
module RSpecHelper
66
module ExecuteRuby
7+
RUBYLIB = ENV["RUBYLIB"]
8+
79
def ruby(script)
8-
Open3.capture3(ruby_path, stdin_data: <<SCRIPT)
10+
child_env = {}
11+
base_dir = File.expand_path("../../..", __FILE__)
12+
lib_dir = File.join(base_dir, "lib")
13+
ext_dir = File.join(base_dir, "ext/pycall")
14+
child_env["RUBYLIB"] = [lib_dir, ext_dir, RUBYLIB].join(File::PATH_SEPARATOR)
15+
Open3.capture3(child_env, ruby_path, stdin_data: <<SCRIPT)
916
require 'bundler'
1017
Bundler.setup
11-
$LOAD_PATH.unshift "#{File.expand_path('../../../lib', __FILE__)}"
1218
1319
#{script}
1420
SCRIPT

0 commit comments

Comments
 (0)