github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/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  }