Skip to content

Commit

Permalink
revert unneeded WithExcludeExtensions from tests (#521)
Browse files Browse the repository at this point in the history
Co-authored-by: Reuven <[email protected]>
  • Loading branch information
reuvenharrison and Reuven authored Apr 9, 2024
1 parent c5dd33f commit 161fffc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions checker/composed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestComposed_Empty(t *testing.T) {
loadFrom(t, "../data/composed/base/", 1),
}

diffReport, _, err := diff.GetPathsDiff(diff.NewConfig().WithExcludeExtensions(), s1, s2)
diffReport, _, err := diff.GetPathsDiff(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.Nil(t, diffReport)
}
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestComposed_CompareMostRecent(t *testing.T) {
loadFrom(t, "../data/composed/revision/", 2),
}

diffReport, _, err := diff.GetPathsDiff(diff.NewConfig().WithExcludeExtensions(), s1, s2)
diffReport, _, err := diff.GetPathsDiff(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.Nil(t, diffReport)
}
2 changes: 1 addition & 1 deletion diff/diff_common_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestDiff_CommonParamsMoved(t *testing.T) {
s2, err := load.NewSpecInfo(loader, load.NewSource("../data/common-params/params_in_op.yaml"), load.WithFlattenParams())
require.NoError(t, err)

d, _, err := diff.GetWithOperationsSourcesMap(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d, _, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.Empty(t, d)
}
Expand Down
4 changes: 2 additions & 2 deletions diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func d(t *testing.T, config *diff.Config, v1, v2 int) *diff.Diff {
}

func TestDiff_Same(t *testing.T) {
require.Nil(t, d(t, diff.NewConfig().WithExcludeExtensions(), 1, 1))
require.Nil(t, d(t, diff.NewConfig(), 1, 1))
}

func TestDiff_Empty(t *testing.T) {
Expand Down Expand Up @@ -823,7 +823,7 @@ func TestDiff_DifferentComponentSameSchema(t *testing.T) {
s1, err := load.NewSpecInfo(openapi3.NewLoader(), load.NewSource("../data/different_component_same_schema.yaml"))
require.NoError(t, err)

d, _, err := diff.GetWithOperationsSourcesMap(diff.NewConfig().WithExcludeExtensions(), s1, s1)
d, _, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s1)
require.NoError(t, err)
require.Empty(t, d)
}
Expand Down
12 changes: 6 additions & 6 deletions diff/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestPatch_MethodDescription(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
Expand All @@ -34,7 +34,7 @@ func TestPatch_ParameterDescription(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
Expand All @@ -51,7 +51,7 @@ func TestPatch_ParameterSchemaFormat(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
Expand All @@ -67,7 +67,7 @@ func TestPatch_ParameterSchemaEnum(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
Expand All @@ -85,7 +85,7 @@ func TestPatch_ParameterSchemaMaxLengthNil(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
Expand All @@ -102,7 +102,7 @@ func TestPatch_ParameterSchemaMaxLength(t *testing.T) {

require.NoError(t, d1.Patch(s1))

d2, err := diff.Get(diff.NewConfig().WithExcludeExtensions(), s1, s2)
d2, err := diff.Get(diff.NewConfig(), s1, s2)
require.NoError(t, err)
require.False(t, d2.GetSummary().Diff)
}
2 changes: 1 addition & 1 deletion report/text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func d(t *testing.T, config *diff.Config, v1, v2 int) *diff.Diff {
}

func Test_NoChanges(t *testing.T) {
require.Equal(t, report.GetTextReportAsString(d(t, diff.NewConfig().WithExcludeExtensions(), 3, 3)), "No changes\n")
require.Equal(t, report.GetTextReportAsString(d(t, diff.NewConfig(), 3, 3)), "No changes\n")
}

func Test_NoEndpointChanges(t *testing.T) {
Expand Down

0 comments on commit 161fffc

Please sign in to comment.