diff options
Diffstat (limited to 'bumper.yarn')
-rw-r--r-- | bumper.yarn | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/bumper.yarn b/bumper.yarn index 230dda7..5f2c3a5 100644 --- a/bumper.yarn +++ b/bumper.yarn @@ -55,10 +55,16 @@ also stored. GIVEN Python project foo, version controlled by git AND a file foolib/version.py in foo containing - ... "__version__ = '0.0'\n__version_info__ = (0, 0)\n" + ... "__version__ = '1.0'\n__version_info__ = (1, 0)\n" AND project foo has Debian packaging -We run Bumper, and it does several things. +We run Bumper to update version numbers and tag a new release. We +first try with a version that's older than the current one. + + WHEN user attempts to run "bumper 0.1" in the foo directory + THEN bumper exits with code 1 + +We now run Bumper properly, and it does its various things. WHEN user runs "bumper 3.2" in the foo directory @@ -125,7 +131,7 @@ for Bumper. dirname = yarnstep.datadir(project) yarnstep.write_file(os.path.join(dirname, 'setup.py'), ''' from distutils.core import setup - setup(name='{project}') + setup(name='{project}', version='1.0') '''.format(project=project)) yarnstep.write_file(os.path.join(dirname, 'NEWS'), ''' NEWS for {project} @@ -156,11 +162,27 @@ for Bumper. dirname = yarnstep.datadir(project) os.mkdir(os.path.join(dirname, 'debian')) cliapp.runcmd( - ['dch', '--create', '-v', '0.0-1', '--package', project, ''], + ['dch', '--create', '-v', '1.0-1', '--package', project, ''], cwd=dirname) cliapp.runcmd(['git', 'add', 'debian'], cwd=dirname) cliapp.runcmd(['git', 'commit', '-m', 'Add debian packaging'], cwd=dirname) + IMPLEMENTS WHEN user attempts to run "bumper (\S+)" in the (\S+) directory + import cliapp, yarnstep + version = yarnstep.get_next_match() + dirname = yarnstep.get_next_match_as_datadir_path() + bin = yarnstep.srcdir('bumper') + returncode, out, err = cliapp.runcmd_unchecked([bin, version], cwd=dirname) + yarnstep.write_file(yarnstep.datadir('bumper.exit'), str(returncode)) + + IMPLEMENTS THEN bumper exits with code (\d+) + import yarnstep + expected = yarnstep.get_next_match() + actual = yarnstep.cat(yarnstep.datadir('bumper.exit')) + print 'expected:', repr(expected) + print 'actual:', repr(actual) + assert expected == actual + IMPLEMENTS WHEN user runs "bumper (\S+)" in the (\S+) directory import cliapp, yarnstep version = yarnstep.get_next_match() |