mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-23 07:21:28 +00:00
Revel tool enhancements
* run Command will choose CWD if no additional arguments are supplied * Added Revel version check, compatible lists are in model/version
This commit is contained in:
@@ -10,15 +10,15 @@ import (
|
||||
func TestEventHandler(t *testing.T) {
|
||||
counter := 0
|
||||
newListener := func(typeOf revel.Event, value interface{}) (responseOf revel.EventResponse) {
|
||||
if typeOf == revel.REVEL_FAILURE {
|
||||
if typeOf == revel.ENGINE_SHUTDOWN_REQUEST {
|
||||
counter++
|
||||
}
|
||||
return
|
||||
}
|
||||
// Attach the same handlder twice so we expect to see the response twice as well
|
||||
// Attach the same handler twice so we expect to see the response twice as well
|
||||
revel.AddInitEventHandler(newListener)
|
||||
revel.AddInitEventHandler(newListener)
|
||||
revel.RaiseEvent(revel.REVEL_AFTER_MODULES_LOADED, nil)
|
||||
revel.RaiseEvent(revel.REVEL_FAILURE, nil)
|
||||
revel.StopServer(1)
|
||||
assert.Equal(t, counter, 2, "Expected event handler to have been called")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user