From 57d3051914f47ecc30055f87cd90ba665a7acb19 Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sun, 31 Aug 2014 20:00:24 +0200 Subject: Automatically upgrade user data when new version was installed. --- spec/PostRunner_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'spec') 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 -- cgit v1.2.3