Exemplo n.º 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")
}
Exemplo n.º 2
0
//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
}