

def test_run_coffee_to_js_on_coffee_file_creates_a_proper_js_file_when_given_valid_input(self):
    contents = ["for name in ['Toran', 'Matt']\n", "  console.log('The name' + name)"]
    sut.write_buffer_contents_to_file(COFFEE_FILE, contents)
    sut.run_coffee_to_js_on_coffee_file()
    expected_js_output = ['(function() {\n', '  var name, _i, _len, _ref;\n', '\n', "  _ref = ['Toran', 'Matt'];\n", '  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n', '    name = _ref[_i];\n', "    console.log('The name' + name);\n", '  }\n', '\n', '}).call(this);\n']
    return_value = read_file_to_list(JS_FILE)[1:]
    self.assertEqual(return_value, expected_js_output)

dataset/ETHPy150Open JarrodCTaylor/vim-js2coffee/tests/vim_js2coffee_tests.py VimCoffee2JSTests.test_run_coffee_to_js_on_coffee_file_creates_a_proper_js_file_when_given_valid_input/original