Skip to content

Commit

Permalink
a more specific error test
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-huganir committed Jun 1, 2024
1 parent febe022 commit 3ef60ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"github.com/stretchr/testify/assert"
"os"
"testing"
)

Expand Down Expand Up @@ -77,7 +78,7 @@ func TestCheckIfDir(t *testing.T) {
isDir, _ = IsDir("../testFiles/data/data1.yaml")
assert.Equal(t, false, isDir)
_, err := IsDir("../testFiles/NotAFile")
assert.ErrorContains(t, err, "The system cannot find the file specified.")
assert.ErrorIs(t, err, os.ErrNotExist)
}

func TestCheckIsFile(t *testing.T) {
Expand All @@ -86,5 +87,5 @@ func TestCheckIsFile(t *testing.T) {
isFile, _ = CheckIfFile("../testFiles/data")
assert.Equal(t, false, isFile)
_, err := CheckIfFile("../testFiles/NotAFile")
assert.ErrorContains(t, err, "The system cannot find the file specified.")
assert.ErrorIs(t, err, os.ErrNotExist)
}
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package internal

import "fmt"

var yutcVersion = "0.0.5"
var yutcVersion = "0.0.6"

func PrintVersion() {
fmt.Println(GetVersion())
Expand Down

0 comments on commit 3ef60ca

Please sign in to comment.