_, version = fakeDB.SetVersionArgsForCall(1) Expect(version).To(Equal(&models.Version{CurrentVersion: 102, TargetVersion: 102})) Expect(fakeMigration.UpCallCount()).To(Equal(1)) Expect(fakeMigration102.UpCallCount()).To(Equal(1)) 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 })