<commit_before>package main_test

import (
	"bytes"
	"os"

	cli "github.com/heroku/cli"

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

var _ = Describe("Help", func() {
	var stdout string
	var stderr string
	exit := 9999

	BeforeEach(func() {
		cli.Stdout = new(bytes.Buffer)
		cli.Stderr = new(bytes.Buffer)
		cli.ExitFn = func(code int) { exit = code }
	})

	AfterEach(func() {
		cli.Stdout = os.Stdout
		cli.Stderr = os.Stderr
	})

	JustBeforeEach(func() {
		stdout = vtclean.Clean(cli.Stdout.(*bytes.Buffer).String(), false)
		stderr = vtclean.Clean(cli.Stderr.(*bytes.Buffer).String(), false)
	})

	Context("with no args", func() {
		BeforeEach(func() {
			cli.Start("heroku")
		})

		It("exits with code 0", func() { Expect(exit).To(Equal(0)) })
		It("shows the help", func() {
			Expect(stdout).To(HavePrefix("Usage: heroku COMMAND [--app APP] [command-specific-options]"))
		})
	})

	Context("heroku help", func() {
		BeforeEach(func() {
			cli.Start("heroku", "help")
		})

		It("exits with code 0", func() { Expect(exit).To(Equal(0)) })
		It("shows the help", func() {
			Expect(stdout).To(HavePrefix("Usage: heroku COMMAND [--app APP] [command-specific-options]"))
		})
	})

	Context("heroku hlp", func() {
		BeforeEach(func() {
			cli.Start("heroku", "hlp")
		})

		It("exits with code 2", func() { Expect(exit).To(Equal(2)) })
		It("shows invalid command message", func() {
			Expect(stderr).To(Equal(` !    hlp is not a heroku command.
 !    Perhaps you meant help.
 !    Run heroku help for a list of available commands.
`))
		})
	})

	Context("heroku help version", func() {
		BeforeEach(func() {
			cli.Start("heroku", "help", "version")
		})

		It("exits with code 0", func() { Expect(exit).To(Equal(0)) })
		It("shows help for version command", func() {
			Expect(stdout).To(HavePrefix("Usage: heroku version"))
		})
	})
})
<commit_msg>remove test for no args<commit_after>package main_test

import (
	"bytes"
	"os"

	cli "github.com/heroku/cli"

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

var _ = Describe("Help", func() {
	var stdout string
	var stderr string
	exit := 9999

	BeforeEach(func() {
		cli.Stdout = new(bytes.Buffer)
		cli.Stderr = new(bytes.Buffer)
		cli.ExitFn = func(code int) { exit = code }
	})

	AfterEach(func() {
		cli.Stdout = os.Stdout
		cli.Stderr = os.Stderr
	})

	JustBeforeEach(func() {
		stdout = vtclean.Clean(cli.Stdout.(*bytes.Buffer).String(), false)
		stderr = vtclean.Clean(cli.Stderr.(*bytes.Buffer).String(), false)
	})

	Context("heroku help", func() {
		BeforeEach(func() {
			cli.Start("heroku", "help")
		})

		It("exits with code 0", func() { Expect(exit).To(Equal(0)) })
		It("shows the help", func() {
			Expect(stdout).To(HavePrefix("Usage: heroku COMMAND [--app APP] [command-specific-options]"))
		})
	})

	Context("heroku hlp", func() {
		BeforeEach(func() {
			cli.Start("heroku", "hlp")
		})

		It("exits with code 2", func() { Expect(exit).To(Equal(2)) })
		It("shows invalid command message", func() {
			Expect(stderr).To(Equal(` !    hlp is not a heroku command.
 !    Perhaps you meant help.
 !    Run heroku help for a list of available commands.
`))
		})
	})

	Context("heroku help version", func() {
		BeforeEach(func() {
			cli.Start("heroku", "help", "version")
		})

		It("exits with code 0", func() { Expect(exit).To(Equal(0)) })
		It("shows help for version command", func() {
			Expect(stdout).To(HavePrefix("Usage: heroku version"))
		})
	})
})

{'fraction_non_alphanumeric': 0.18927355278093075, 'fraction_numerical': 0.006242905788876277, 'mean_word_length': 3.828767123287671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '288071', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1298, 'n_words': 276}