github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/updater/error_test.go (about)

     1  // Copyright 2016 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  package updater
     5  
     6  import (
     7  	"fmt"
     8  	"testing"
     9  
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestNewError(t *testing.T) {
    14  	err := NewError(PromptError, fmt.Errorf("There was an error prompting"))
    15  	assert.EqualError(t, err, "Update Error (prompt): There was an error prompting")
    16  }
    17  
    18  func TestNewErrorNil(t *testing.T) {
    19  	err := NewError(PromptError, nil)
    20  	assert.EqualError(t, err, "Update Error (prompt)")
    21  }