

def test_run_js_to_coffee_on_js_file_creates_a_proper_coffee_file_when_given_valid_input(self):
    contents = ['var example = function() {\n', "    console.log('This is another example');\n", '}']
    sut.write_buffer_contents_to_file(JS_FILE, contents)
    sut.run_js_to_coffee_on_js_file()
    expected_coffee_output = ['example = ->\n', '  console.log "This is another example"\n', '  return\n']
    self.assertEqual(read_file_to_list(COFFEE_FILE), expected_coffee_output)

dataset/ETHPy150Open JarrodCTaylor/vim-js2coffee/tests/vim_js2coffee_tests.py VimJS2CoffeeTests.test_run_js_to_coffee_on_js_file_creates_a_proper_coffee_file_when_given_valid_input/original