-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Forbid also the usage of the `Focus` individual spec, e.g. It("test something", Focus, func(){ Expect(...)... }) 2. Add `FDescribeTable` and `FEntry` to the forbiden containers.
- Loading branch information
Showing
10 changed files
with
201 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package focus | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("focused Describe", Focus, func() { | ||
When("focused when", Focus, func() { | ||
Context("focused Context", Focus, func() { | ||
It("focused It", Focus, func() { | ||
Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package focus | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("test focused tables", func() { | ||
FDescribeTable("focused table", func(s []int, l int) { | ||
Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` | ||
}, | ||
Entry([]int{1, 2, 3, 4}, 4), | ||
FEntry([]int{1, 2, 3, 4, 5}, 5), | ||
) | ||
|
||
DescribeTable("non-focused table", func(s []int, l int) { | ||
Expect(s).Should(HaveLen(l)) | ||
}, | ||
Entry([]int{1, 2, 3, 4}, 4), | ||
FEntry([]int{1, 2, 3, 4, 5}, 5), | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package focus | ||
|
||
import ( | ||
"github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = ginkgo.Describe("focused Describe", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
ginkgo.When("focused when", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
ginkgo.Context("focused Context", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
ginkgo.It("focused It", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package focus | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("focused Describe", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
When("focused when", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
Context("focused Context", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
It("focused It", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package focus | ||
|
||
import ( | ||
gnk "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = gnk.Describe("test focused tables", func() { | ||
gnk.FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "DescribeTable"` | ||
Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` | ||
}, | ||
gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
|
||
gnk.DescribeTable("non-focused table", func(s []int, l int) { | ||
Expect(s).Should(HaveLen(l)) | ||
}, | ||
gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
|
||
gnk.DescribeTable("spec focused table", gnk.Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
Expect(s).Should(HaveLen(l)) | ||
}, | ||
gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package focus | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("test focused tables", func() { | ||
FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "DescribeTable"` | ||
Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` | ||
}, | ||
Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
|
||
DescribeTable("non-focused table", func(s []int, l int) { | ||
Expect(s).Should(HaveLen(l)) | ||
}, | ||
Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
|
||
DescribeTable("spec focused table", Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
Expect(s).Should(HaveLen(l)) | ||
}, | ||
Entry("check slice not focused", []int{1, 2, 3, 4}, 4), | ||
Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` | ||
FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters