github.com/kcmerrill/alfred@v0.0.0-20180727171036-06445dcb5e3d/pkg/alfred/task_test.go (about) 1 package alfred 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestNewTask(t *testing.T) { 10 tasks := make(map[string]Task) 11 tasks["hello.world"] = Task{ 12 Summary: "Hello world! How are you!", 13 Command: "whoami && sleep 1", 14 } 15 NewTask("hello.world", InitialContext([]string{}), tasks) 16 } 17 18 func TestTaskIsPrivate(t *testing.T) { 19 task := Task{ 20 Summary: "A non private task here", 21 } 22 assert.Equal(t, false, task.IsPrivate(), "Task should be private") 23 24 task = Task{} 25 assert.Equal(t, true, task.IsPrivate(), "Task should be private") 26 }