Skip to content

Commit 72e58fd

Browse files
committed
test: Fix integration test
1 parent 220ff01 commit 72e58fd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
for adapter in $ADAPTERS; do
8080
export IRUBY_TEST_SESSION_ADAPTER_NAME=$adapter
81-
bundle exec rake test TESTOPTS="-v -x integration"
81+
bundle exec rake test TESTOPTS="-v"
8282
done
8383
8484
windows:

test/integration_test.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
require 'bundler'
12
require 'pty'
23
require 'expect'
34

45
class IRubyTest::IntegrationTest < IRubyTest::TestBase
56
def setup
6-
$expect_verbose = false # make true if you want to dump the output of iruby console
7+
system(*iruby_command("register", "--name=iruby-test"), out: File::NULL, err: File::NULL)
8+
kernel_json = File.join(ENV["JUPYTER_DATA_DIR"], "kernels", "iruby-test", "kernel.json")
9+
assert_path_exist kernel_json
710

8-
@in, @out, pid = PTY.spawn('bin/iruby --simple-prompt')
11+
$expect_verbose = true # make true if you want to dump the output of iruby console
12+
13+
command = iruby_command("console", "--kernel=iruby-test").map {|x| %Q["#{x}"] }
14+
@in, @out, pid = PTY.spawn(command.join(" "))
915
@waiter = Thread.start { Process.waitpid(pid) }
1016
expect 'In [', 30
1117
expect '1'

test/run-test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
$VERBOSE = true
44

5+
require "bundler/setup"
56
require "pathname"
67

78
base_dir = Pathname.new(__dir__).parent.expand_path

0 commit comments

Comments
 (0)