예제 #1
0
func Test_plurkModuleLoader(t *testing.T) {
	vm := motto.New()
	module, _ := plurkModuleLoader(vm)
	// Convert to Object
	moduleObject := module.Object()
	keys := moduleObject.Keys()

	assert.Contains(t, keys, "addPlurk")
	assert.Contains(t, keys, "addResponse")
}
예제 #2
0
파일: otto.go 프로젝트: cloudwan/gohan
//NewEnvironment create new gohan extension environment based on context
func NewEnvironment(name string, dataStore db.DB, identity middleware.IdentityService, timelimit time.Duration) *Environment {
	vm := motto.New()
	vm.Interrupt = make(chan func(), 1)
	env := &Environment{
		Name:      name,
		VM:        vm,
		DataStore: dataStore,
		Identity:  identity,
		timelimit: timelimit,
	}
	env.SetUp()
	return env
}