Skip to content

Instantly share code, notes, and snippets.

@wjlow
Last active May 28, 2018 06:05
Show Gist options
  • Save wjlow/7d35b3c4592d7ed7dc4068b8021229be to your computer and use it in GitHub Desktop.
Save wjlow/7d35b3c4592d7ed7dc4068b8021229be to your computer and use it in GitHub Desktop.
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