コード例 #1
0
ファイル: manager_test.go プロジェクト: emc-xchallenge/bbs
			Expect(fakeMigration.DownCallCount()).To(Equal(0))
			Expect(fakeMigration102.DownCallCount()).To(Equal(0))
		})

		It("sets the store client on the migration", func() {
			Eventually(migrationProcess.Ready()).Should(BeClosed())
			Expect(migrationsDone).To(BeClosed())
			Expect(fakeMigration.SetStoreClientCallCount()).To(Equal(1))
			actualStoreClient := fakeMigration.SetStoreClientArgsForCall(0)
			Expect(actualStoreClient).To(Equal(storeClient))
		})

		It("sets the cryptor on the migration", func() {
			Eventually(migrationProcess.Ready()).Should(BeClosed())
			Expect(migrationsDone).To(BeClosed())
			Expect(fakeMigration.SetCryptorCallCount()).To(Equal(1))
			actualCryptor := fakeMigration.SetCryptorArgsForCall(0)
			Expect(actualCryptor).To(Equal(cryptor))
		})

		Context("when the target version is greater than the bbs migration version", func() {
			BeforeEach(func() {
				dbVersion.TargetVersion = 103
			})

			It("runs the migrations up to the bbs migration version", func() {
				Eventually(migrationProcess.Ready()).Should(BeClosed())
				Expect(migrationsDone).To(BeClosed())
				Consistently(fakeDB.SetVersionCallCount).Should(Equal(2))

				_, version := fakeDB.SetVersionArgsForCall(0)