Exemplo n.º 1
0
var _ = Describe("SSHOptions", func() {
	var (
		opts       *options.SSHOptions
		args       []string
		parseError error
	)

	Describe("Parse", func() {
		BeforeEach(func() {
			opts = options.NewSSHOptions()
			args = []string{"ssh"}
			parseError = nil
		})

		JustBeforeEach(func() {
			parseError = opts.Parse(args)
		})

		Context("when the command name is missing", func() {
			BeforeEach(func() {
				args = []string{}
			})

			It("returns a UsageError", func() {
				Expect(parseError).To(Equal(options.UsageError))
			})
		})

		Context("when the wrong command name is present", func() {
			BeforeEach(func() {
				args = []string{"scp"}