address = "GAXEMCEXBERNSRXOEKD4JAIKVECIXQCENHEBRVSPX2TTYZPMNEDSQCNQ" bad = "foo" ) JustBeforeEach(func() { subject = ManageDataBuilder{} subject.Mutate(mut) }) Describe("SourceAccount", func() { Context("using a valid stellar address", func() { BeforeEach(func() { mut = SourceAccount{address} }) It("succeeds", func() { Expect(subject.Err).NotTo(HaveOccurred()) }) It("sets the destination to the correct xdr.AccountId", func() { var aid xdr.AccountId aid.SetAddress(address) Expect(subject.O.SourceAccount.MustEd25519()).To(Equal(aid.MustEd25519())) }) }) Context("using an invalid value", func() { BeforeEach(func() { mut = SourceAccount{bad} }) It("failed", func() { Expect(subject.Err).To(HaveOccurred()) }) }) }) })