Skip to content

Instantly share code, notes, and snippets.

@mrkurt
Created April 19, 2009 15:29
Show Gist options
  • Save mrkurt/98101 to your computer and use it in GitHub Desktop.
Save mrkurt/98101 to your computer and use it in GitHub Desktop.
class TestRunner(unittest.TestCase):
def test_simple_js(self):
result = Runner().run_js('"kurt rocks";')
self.assertEqual(result, 'kurt rocks')
def test_longer_js(self):
result = Runner().run_js('var blah = "kurt rocks";\nblah;')
self.assertEqual(result, 'kurt rocks')
def test_complex_return(self):
result = Runner().run_js('var complex = { "kurt" : "rocks", "when" : ["mon", "tues", "fri"] };\ncomplex;')
self.assertEqual(result.kurt, "rocks")
self.assertEqual(len(result.when), 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment