github.com/kcmerrill/alfred@v0.0.0-20180727171036-06445dcb5e3d/pkg/alfred/context_test.go (about)

     1  package alfred
     2  
     3  import "testing"
     4  
     5  func TestInitialContext(t *testing.T) {
     6  	c := InitialContext([]string{"one", "two"})
     7  	c.Text.DisableFormatting = true
     8  
     9  	if c.TaskName == "" {
    10  		t.Fatalf("The taskname shouldn't be blank")
    11  	}
    12  
    13  	if c.Text.Failure == "" {
    14  		t.Fatalf("The text object should not be empty")
    15  	}
    16  
    17  	if c.Args[1] != "two" {
    18  		t.Fatalf("Default args should be set")
    19  	}
    20  }