summaryrefslogtreecommitdiff
path: root/spec/PostRunner_spec.rb
diff options
context:
space:
mode:
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