Skip to content

Commit 6a02ad3

Browse files
committed
update test
1 parent 26a4c09 commit 6a02ad3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/instance_test.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ def test_invalid_module
3636
end
3737

3838
def test_basic_sum
39-
assert_equal 3, Wasmer::Instance.new(self.bytes).exports.sum(1, 2)
39+
exports = Wasmer::Instance.new(self.bytes).exports
40+
assert exports.respond_to?(:sum)
41+
assert_equal 3, exports.sum(1, 2)
4042
end
4143

4244
def test_call_unknown_function
45+
exports = Wasmer::Instance.new(self.bytes).exports
46+
assert !exports.respond_to?(:foo)
4347
error = assert_raises(RuntimeError) {
44-
Wasmer::Instance.new(self.bytes).exports.foo
48+
exports.foo
4549
}
4650
assert_equal "Function `foo` does not exist.", error.message
4751
end

0 commit comments

Comments
 (0)