Skip to content

Commit 157b286

Browse files
committed
added tests for ruby kernel
1 parent 9fae28d commit 157b286

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

js/tests/defaultKernels.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ sandboxTest('test ts kernel errors', async ({ sandbox }) => {
2323
})
2424
expect(output.error?.name).toEqual('TypeScriptCompilerError')
2525
})
26+
27+
sandboxTest('test ruby kernel', async ({ sandbox }) => {
28+
const output = await sandbox.runCode('puts "Hello World!"', {
29+
language: 'ruby',
30+
})
31+
expect(output.logs.stdout).toEqual(['Hello World!\n'])
32+
})

python/tests/async/test_async_default_kernels.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ async def test_ts_kernel_errors(async_sandbox: AsyncSandbox):
2121
)
2222
assert execution.error is not None
2323
assert execution.error.name == "TypeScriptCompilerError"
24+
25+
26+
async def test_ruby_kernel(async_sandbox: AsyncSandbox):
27+
execution = await async_sandbox.run_code("puts 'Hello, World!'", language="ruby")
28+
assert execution.logs.stdout == ["Hello, World!\n"]

python/tests/sync/test_default_kernels.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ def test_ts_kernel_errors(sandbox: Sandbox):
3030
execution = sandbox.run_code("import x from 'module';", language="ts")
3131
assert execution.error is not None
3232
assert execution.error.name == "TypeScriptCompilerError"
33+
34+
35+
def test_ruby_kernel(sandbox: Sandbox):
36+
execution = sandbox.run_code("puts 'Hello, World!'", language="ruby")
37+
assert execution.logs.stdout == ["Hello, World!\n"]

0 commit comments

Comments
 (0)