From c971854ea7dc8ed26d9e858d57c203eccbb06d54 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Tue, 22 Jul 2014 12:18:39 +0100 Subject: [PATCH] Consistant Capistrano::VERSION interface The latest version of Capistrano uses Capistrano::VERSION for storing the gem version. This change adds a constant to match this interface for v2. --- lib/capistrano/version.rb | 2 ++ test/version_test.rb | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/version_test.rb diff --git a/lib/capistrano/version.rb b/lib/capistrano/version.rb index 9890cda5..f7a9c4dc 100644 --- a/lib/capistrano/version.rb +++ b/lib/capistrano/version.rb @@ -8,4 +8,6 @@ module Capistrano "#{MAJOR}.#{MINOR}.#{PATCH}" end end + + VERSION = Version.to_s end diff --git a/test/version_test.rb b/test/version_test.rb new file mode 100644 index 00000000..0b5d6b1e --- /dev/null +++ b/test/version_test.rb @@ -0,0 +1,11 @@ +require 'capistrano/version' + +class VersionTest < Test::Unit::TestCase + def test_version_constant_is_not_nil + assert_not_nil Capistrano::VERSION + end + + def test_version_constant_matches_class_method + assert_equal Capistrano::VERSION, Capistrano::Version.to_s + end +end