Skip to content

Instantly share code, notes, and snippets.

@vs
Created November 22, 2010 18:22
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 vs/710378 to your computer and use it in GitHub Desktop.
Save vs/710378 to your computer and use it in GitHub Desktop.
Test notation
class GsTest {
static {
File.metaClass.div = { path ->
new File(delegate.toString(), path.toString())
}
GsSvnUrl.metaClass.div = { path ->
delegate.appendPath(path.toString())
}
}
GsSvnScenario svn = new GsSvnScenario(rootUrl: GsSvnUrl.parseURIEncoded('http://localhost'), rootPath: new File('/tmp/groovy-test/svn'))
GsGitScenario git = new GsGitScenario(rootPath: new File('/tmp/groovy-test/git'))
@WithExecutableStrings
void initialImport() {
def init = { File dir ->
dir.mkdir()
File file = dir / 'file.txt'
file << "Some text added into $file"
}
svn.script = {
init svn.trunk.wc
"svn import -m 'Initial commit' $svn.trunk.wc $svn.trunk.url"
}
git.script = {
init git.wt
"git init"
"git add ."
"git commit -m 'Initial commit'"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment