thinca / vim-themis

A testing framework for Vim script.
zlib License
238 stars 34 forks source link

Add 'global' helper to register events globally #42

Open lambdalisue opened 8 years ago

lambdalisue commented 8 years ago

To solve #26. I create a 'global' helper which can register events globally like:

let s:events = {}

function! s:events.initialize() abort
  call themis#log('Initialize')
endfunction

function! s:events.before() abort
  call themis#log('Before')
endfunction

function! s:events.before_each() abort
  call themis#log('Before each')
endfunction

function! s:events.after_each() abort
  call themis#log('After each')
endfunction

function! s:events.after() abort
  call themis#log('After')
endfunction

function! s:events.finalize() abort
  call themis#log('Finalize')
endfunction

" Register global event
call themis#helper('global').with(s:events)
thinca commented 8 years ago

すいませんがちょっと保留させてください。インターフェースがちょっとしっくり来ない…(主に with)。

lambdalisue commented 8 years ago

Oh. 了解しました。

lambdalisue commented 6 years ago

ping

lambdalisue commented 4 years ago

これ

call themis#helper('global').use(s:events)

とかだとシックリきたりします?w