twolfson / sublime-plugin-tests

Testing framework for Sublime Text plugins
The Unlicense
22 stars 2 forks source link

Consider unifying `init` and `--command` technique #23

Open twolfson opened 11 years ago

twolfson commented 11 years ago

It would be nice to have a consistent implementation for Sublime Text 2 and 3. Currently, some advantages of --command over init are:

Maybe we can add a temporary file that gets deleted when init runs for the first time? It would level the playing field.

# framework.py
with open('.can_run') as f:
  f.write('1')
launch()

# init.py
if os.path.exists('.can_run'):
  os.unlink('.can_run')
  set_timeout()
twolfson commented 11 years ago

The advantage of init over --command is it can be updated without freezing the command for locking later on (requires a restart).