Skip to content

Commit

Permalink
Rewrite unit tests in internal/kubebuilder/filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
varshaprasad96 committed Dec 4, 2020
1 parent 5a5c4fc commit f1f5926
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 97 deletions.
84 changes: 5 additions & 79 deletions go.sum

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions internal/kubebuilder/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
27 changes: 27 additions & 0 deletions internal/kubebuilder/filesystem/filesystem_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
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 TestScaffold(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Filesystem Suite")
}
6 changes: 0 additions & 6 deletions internal/kubebuilder/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 internal/kubebuilder/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
2 changes: 2 additions & 0 deletions internal/kubebuilder/machinery/machinery_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
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.
Expand Down

0 comments on commit f1f5926

Please sign in to comment.