Skip to content

Instantly share code, notes, and snippets.

@dhemery
Created July 18, 2013 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhemery/6033628 to your computer and use it in GitHub Desktop.
Save dhemery/6033628 to your computer and use it in GitHub Desktop.
Suddenly my tests became Gherkin. I like it for these two tests. Will I like it for more?
@Test
public void copiesPlainFilesFromSourceRootToSiteRoot() {
given(sourceFile("foo.txt"), withContent("foo content"));
when(jogger, runs());
then(siteFile("foo.txt"), content(), is("foo content"));
}
@Test
public void copiesPlainFilesFromSourceSubdirectoryToCorrespondingSiteSubdirectory() {
given(sourceFile("my/subdirectory/foo.txt"), withContent("subdirectory foo content"));
when(jogger, runs());
then(siteFile("my/subdirectory/foo.txt"), content(), is("subdirectory foo content"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment