...
 
Commits (2)
# frozen_string_literal: true
def get_version(args)
version = ReleaseTools::Version.new(args[:version])
version = ReleaseTools::Version.new(args)
unless version.valid?
$stdout.puts "Version number must be in the following format: X.Y.Z-rc1 or X.Y.Z".colorize(:red)
exit 1
raise "Version number must be in the following format: X.Y.Z-rc1 or X.Y.Z"
end
version
......
# frozen_string_literal: true
require 'spec_helper'
describe ReleaseTools do
describe 'get_version' do
it 'converts input to version' do
version = get_version('11.9.4')
expect(version).to be_kind_of(ReleaseTools::Version)
end
it 'fails to convert input to version' do
pending
expect(get_version('foo')).to raise_error
end
end
end