Instantly share code, notes, and snippets.

@wjlow /decorator2.md
Last active May 28, 2018

Embed
What would you like to do?
val input: Seq[RawListing] = //... fixture
def transform(in: RawListing): FullListing = //... trivial
var savedResult: String = null
def save(json: String): Async[Unit] = Async {
  insertResultHere = json
}
val expectedResult = //... actually generate some sort of JSON

val processor = new ListingProcessor(transform, save)
processor.processListings(input)
//... resolve asynchrony

assertEquals(expectedResult, savedResult) // Or regex acrobatics, etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment