summaryrefslogtreecommitdiff
path: root/spec/PostRunner_spec.rb
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-08-31 20:00:24 +0200
committerChris Schlaeger <chris@linux.com>2014-08-31 20:00:24 +0200
commit57d3051914f47ecc30055f87cd90ba665a7acb19 (patch)
tree02cf8c2d3f8b49e7959c0e1cef97b2f27c5cac38 /spec/PostRunner_spec.rb
parentb734d9c18e3145e7ff74bbb10e39aea6c36f3800 (diff)
downloadpostrunner-57d3051914f47ecc30055f87cd90ba665a7acb19.zip
Automatically upgrade user data when new version was installed.
Diffstat (limited to 'spec/PostRunner_spec.rb')
-rw-r--r--spec/PostRunner_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/PostRunner_spec.rb b/spec/PostRunner_spec.rb
index 9755a7c..d111b81 100644
--- a/spec/PostRunner_spec.rb
+++ b/spec/PostRunner_spec.rb
@@ -122,5 +122,21 @@ describe PostRunner::Main do
postrunner(%w( units metric ))
end
+ it 'should properly upgrade to a new version' do
+ # Change version in config file to 0.0.0.
+ rc = PostRunner::RuntimeConfig.new(@db_dir)
+ rc.set_option(:version, '0.0.0')
+ # Check that the config file really was changed.
+ rc = PostRunner::RuntimeConfig.new(@db_dir)
+ rc.get_option(:version).should == '0.0.0'
+
+ # Run some command.
+ postrunner(%w( list ))
+
+ # Check that version matches the current version again.
+ rc = PostRunner::RuntimeConfig.new(@db_dir)
+ rc.get_option(:version).should == PostRunner::VERSION
+ end
+
end