Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/npm-packages/ruby-wasm-wasi/test/unit/test_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require "js"

class JS::TestError < Test::Unit::TestCase
using JsObjectTestable

def test_throw_error
e = assert_raise(JS::Error) { JS.eval("throw new Error('foo')") }
assert_match /^Error: foo/, e.message
Expand Down
2 changes: 0 additions & 2 deletions packages/npm-packages/ruby-wasm-wasi/test/unit/test_float.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require "js"

class JS::TestFloat < Test::Unit::TestCase
using JsObjectTestable

def test_to_js
assert_equal (1.0).to_js, JS.eval("return 1.0;")
assert_equal (0.5).to_js, JS.eval("return 0.5;")
Expand Down
13 changes: 0 additions & 13 deletions packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,9 @@ const test = async (instantiate) => {
const rootTestFile = "/__root__/test/test_unit.rb";
const { vm } = await instantiate(rootTestFile);


await vm.evalAsync(`
require 'test/unit'

# FIXME: This is a workaround for the test-unit gem.
# It will be removed when the next pull request is merged and released.
# https://github.com/test-unit/test-unit/pull/262
require 'pp'
module JsObjectTestable
refine JS::Object do
[:object_id, :pretty_inspect].each do |method|
define_method(method, ::Object.instance_method(method))
end
end
end

require_relative '${rootTestFile}'
ok = Test::Unit::AutoRunner.run
exit(1) unless ok
Expand Down
Loading