Skip to content

Commit

Permalink
Updated Generate tests to check dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
snopan committed Jun 24, 2024
1 parent 77d344b commit 0df9e5c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/outputter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,17 @@ func TestOutputter_Generate(t *testing.T) {
name string
packagePath string
fields fields
wantErr bool
dryRun bool
}{
{
name: "generate normal",
packagePath: "github.com/vektra/mockery/v2/pkg/fixtures/example_project",
dryRun: false,
},
{
name: "generate normal",
packagePath: "github.com/vektra/mockery/v2/pkg/fixtures/example_project",
dryRun: true,
},
}
for _, tt := range tests {
Expand All @@ -237,7 +243,7 @@ func TestOutputter_Generate(t *testing.T) {
m := &Outputter{
boilerplate: tt.fields.boilerplate,
config: tt.fields.config,
dryRun: true,
dryRun: tt.dryRun,
}
parser := NewParser([]string{})

Expand Down Expand Up @@ -265,7 +271,7 @@ packages:
t.Logf("checking if path exists: %v", mockPath)
exists, err := mockPath.Exists()
require.NoError(t, err)
assert.True(t, exists)
assert.Equal(t, !tt.dryRun, exists)
}
})
}
Expand Down

0 comments on commit 0df9e5c

Please sign in to comment.