Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Oct 18, 2024
1 parent 9d17ec5 commit cd91ebc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/super/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package generator

import (
"embed"
"fmt"
"path/filepath"
"testing"
Expand All @@ -30,11 +31,8 @@ import (
"github.com/onflow/flow-cli/internal/util"
)

// go:embed fixtures/README_no_deps.md
var readmeNoDepsFixture string

// go:embed fixtures/README_with_deps.md
var readmeWithDepsFixture string
//go:embed fixtures/*.*
var fixturesFS embed.FS

func TestGenerateNewContract(t *testing.T) {
logger := output.NewStdoutLogger(output.NoneLog)
Expand Down Expand Up @@ -258,7 +256,8 @@ func TestGenerateReadmeNoDeps(t *testing.T) {
assert.NoError(t, err, "Failed to read generated file")
assert.NotNil(t, content)

assert.Equal(t, readmeNoDepsFixture, string(content))
readmeNoDepsFixture, _ := fixturesFS.ReadFile("fixtures/README_no_deps.md")
assert.Equal(t, string(readmeNoDepsFixture), string(content))
}

func TestGenerateReadmeWithDeps(t *testing.T) {
Expand Down Expand Up @@ -294,5 +293,6 @@ func TestGenerateReadmeWithDeps(t *testing.T) {
assert.NoError(t, err, "Failed to read generated file")
assert.NotNil(t, content)

assert.Equal(t, readmeWithDepsFixture, string(content))
readmeWithDepsFixture, _ := fixturesFS.ReadFile("fixtures/README_with_deps.md")
assert.Equal(t, string(readmeWithDepsFixture), string(content))
}

0 comments on commit cd91ebc

Please sign in to comment.