From 6a1bf0c9c8e1f50190fe110b3514b5f092b20d24 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Sun, 6 Feb 2011 19:10:05 -0600 Subject: [PATCH] Make the readme example work --- test/test_execjs.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/test_execjs.rb diff --git a/test/test_execjs.rb b/test/test_execjs.rb new file mode 100644 index 0000000..095181a --- /dev/null +++ b/test/test_execjs.rb @@ -0,0 +1,12 @@ +require "execjs" +require "test/unit" + +class TestExecJS < Test::Unit::TestCase + def test_exec + assert_equal true, ExecJS.exec("return true") + end + + def test_eval + assert_equal ["red", "yellow", "blue"], ExecJS.eval("'red yellow blue'.split(' ')") + end +end