Esempio n. 1
0
		})

		It("returns false if there is a JobName", func() {
			build := db.Build{
				JobName: "something",
			}
			Ω(build.OneOff()).Should(BeFalse())
		})
	})

	Describe("IsRunning", func() {
		It("returns true if the build is pending", func() {
			build := db.Build{
				Status: db.StatusPending,
			}
			Ω(build.Abortable()).Should(BeTrue())
		})

		It("returns true if the build is started", func() {
			build := db.Build{
				Status: db.StatusStarted,
			}
			Ω(build.Abortable()).Should(BeTrue())
		})

		It("returns false if in any other state", func() {
			states := []db.Status{
				db.StatusAborted,
				db.StatusErrored,
				db.StatusFailed,
				db.StatusSucceeded,
Esempio n. 2
0
		})

		It("returns false if there is a JobName", func() {
			build := db.Build{
				JobName: "something",
			}
			Expect(build.OneOff()).To(BeFalse())
		})
	})

	Describe("IsRunning", func() {
		It("returns true if the build is pending", func() {
			build := db.Build{
				Status: db.StatusPending,
			}
			Expect(build.Abortable()).To(BeTrue())
		})

		It("returns true if the build is started", func() {
			build := db.Build{
				Status: db.StatusStarted,
			}
			Expect(build.Abortable()).To(BeTrue())
		})

		It("returns false if in any other state", func() {
			states := []db.Status{
				db.StatusAborted,
				db.StatusErrored,
				db.StatusFailed,
				db.StatusSucceeded,