Skip to content

Commit

Permalink
Merge pull request #557 from ledsun/remove_patch_of_test-unit
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun authored Nov 24, 2024
2 parents ba16cca + 9e5a997 commit 2ba4910
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
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

0 comments on commit 2ba4910

Please sign in to comment.