mirror of
https://github.com/maaslalani/slides.git
synced 2026-01-08 22:07:59 -05:00
Closes #1. This change allows users to add a configuration section to their slides, which allows them to specify a different theme if they would like to change the styles of the default theme. A user can add ``` --- theme: ascii --- ``` To use an ascii theme or use `theme: ./styles.json` to specify their own custom JSON theme using glamour styles. Co-authored-by: Britton Hayes <brittonhayes@users.noreply.github.com>
29 lines
606 B
Go
29 lines
606 B
Go
package file_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/maaslalani/slides/internal/file"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestExists(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
filepath string
|
|
want bool
|
|
}{
|
|
{name: "Find file exists", filepath: "file.go", want: true},
|
|
{name: "Return false for missing file", filepath: "afilethatdoesntexist.go", want: false},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
isExist := file.Exists(tt.filepath)
|
|
if isExist {
|
|
assert.FileExists(t, tt.filepath)
|
|
}
|
|
assert.Equal(t, tt.want, isExist)
|
|
})
|
|
}
|
|
}
|