-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #369 from CircleCI-Public/build-config-2-1-two
CIRCLE-25004 Support Config Version 2.1 in Local Builds
- Loading branch information
Showing
9 changed files
with
228 additions
and
252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,8 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/CircleCI-Public/circleci-cli/local" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("build", func() { | ||
|
||
Describe("local execute", func() { | ||
It("provides a help documentation when provided with a --help flag", func() { | ||
called := false | ||
mockHelp := func() error { | ||
called = true | ||
return nil | ||
} | ||
mockOptions := local.BuildOptions{ | ||
Args: []string{"--help"}, | ||
Help: mockHelp, | ||
} | ||
err := local.Execute(mockOptions) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(called).To(BeTrue()) | ||
}) | ||
|
||
It("provides a help documentation when provided with a --help flag mixed with other flags", func() { | ||
called := false | ||
mockHelp := func() error { | ||
called = true | ||
return nil | ||
} | ||
mockOptions := local.BuildOptions{ | ||
Args: []string{"--skip-checkout", "--help"}, | ||
Help: mockHelp, | ||
} | ||
err := local.Execute(mockOptions) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(called).To(BeTrue()) | ||
}) | ||
|
||
It("provides a help documentation when provided with a -h flag", func() { | ||
called := false | ||
mockHelp := func() error { | ||
called = true | ||
return nil | ||
} | ||
mockOptions := local.BuildOptions{ | ||
Args: []string{"-h"}, | ||
Help: mockHelp, | ||
} | ||
err := local.Execute(mockOptions) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(called).To(BeTrue()) | ||
}) | ||
|
||
It("provides a help documentation when provided with a -h flag mixed with other flags", func() { | ||
called := false | ||
mockHelp := func() error { | ||
called = true | ||
return nil | ||
} | ||
mockOptions := local.BuildOptions{ | ||
Args: []string{"--skip-checkout", "-h"}, | ||
Help: mockHelp, | ||
} | ||
err := local.Execute(mockOptions) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(called).To(BeTrue()) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.