Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix unit tests to work with later versions of ginkgo/gomega #2039

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ go 1.15

require (
github.com/gobuffalo/flect v0.2.2
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
github.com/spf13/afero v1.2.2
github.com/spf13/cobra v0.0.7
github.com/spf13/pflag v1.0.5
golang.org/x/tools v0.0.0-20200403190813-44a64ad78b9b
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e
sigs.k8s.io/yaml v1.2.0
)
82 changes: 52 additions & 30 deletions go.sum

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions pkg/plugins/internal/filesystem/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ package filesystem
import (
"errors"
"path/filepath"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
)

func TestErrors(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Error suite")
}

var _ = Describe("Errors", func() {
var (
path = filepath.Join("path", "to", "file")
Expand Down
29 changes: 29 additions & 0 deletions pkg/plugins/internal/filesystem/filesystem_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2021 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package filesystem

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestFilesystem(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Filesystem suite")
}
6 changes: 0 additions & 6 deletions pkg/plugins/internal/filesystem/filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@ package filesystem

import (
"os"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestFileSystem(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "FileSystem suite")
}

var _ = Describe("FileSystem", func() {
Describe("New", func() {
const (
Expand Down
6 changes: 0 additions & 6 deletions pkg/plugins/internal/filesystem/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ import (
"bytes"
"errors"
"path/filepath"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestMockFileSystem(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "MockFileSystem suite")
}

//nolint:dupl
var _ = Describe("MockFileSystem", func() {
var (
Expand Down
6 changes: 0 additions & 6 deletions pkg/plugins/internal/machinery/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ package machinery
import (
"errors"
"path/filepath"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
)

func TestErrors(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Error suite")
}

var _ = Describe("Errors", func() {
var (
path = filepath.Join("path", "to", "file")
Expand Down
29 changes: 29 additions & 0 deletions pkg/plugins/internal/machinery/machinery_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2021 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package machinery

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestMachinery(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Machinery suite")
}
6 changes: 0 additions & 6 deletions pkg/plugins/internal/machinery/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package machinery
import (
"bytes"
"errors"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand All @@ -28,11 +27,6 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/internal/filesystem"
)

func TestScaffold(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Scaffold suite")
}

var _ = Describe("Scaffold", func() {
Describe("NewScaffold", func() {
var (
Expand Down