Skip to content

Commit

Permalink
Consistant Capistrano::VERSION interface
Browse files Browse the repository at this point in the history
The latest version of Capistrano uses Capistrano::VERSION for storing the gem
version. This change adds a constant to match this interface for v2.
  • Loading branch information
Sasha Gerrand authored and Lee Hambley committed Jun 17, 2015
1 parent bbc7abb commit c971854
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/capistrano/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ def self.to_s
"#{MAJOR}.#{MINOR}.#{PATCH}"
end
end

VERSION = Version.to_s
end
11 changes: 11 additions & 0 deletions test/version_test.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c971854

Please sign in to comment.