Close subscription in integration test

* This was causing issues in future tests,
   since the subscription was causing blocks
   and transactions to be added to the DB
This commit is contained in:
Eric Meyer
2017-11-03 08:56:58 -05:00
parent 4733b25f54
commit 0262a99321
6 changed files with 47 additions and 8 deletions
+13 -3
View File
@@ -22,11 +22,21 @@ func RunTimePath() string {
var _ = Describe("Reading from the Geth blockchain", func() {
It("reads two blocks", func(done Done) {
observer := fakes.NewFakeBlockchainObserverTwo()
var listener blockchain_listener.BlockchainListener
var observer *fakes.BlockchainObserver
BeforeEach(func() {
observer = fakes.NewFakeBlockchainObserverTwo()
blockchain := geth.NewGethBlockchain(RunTimePath() + "/test_data_dir/geth.ipc")
observers := []core.BlockchainObserver{observer}
listener := blockchain_listener.NewBlockchainListener(blockchain, observers)
listener = blockchain_listener.NewBlockchainListener(blockchain, observers)
})
AfterEach(func() {
listener.Stop()
})
It("reads two blocks", func(done Done) {
go listener.Start()
<-observer.WasNotified