spec/appversion_spec.rb in overview-0.0.3.61 vs spec/appversion_spec.rb in overview-0.0.4.12
- old
+ new
@@ -1,61 +1,30 @@
require 'spec_helper'
-require 'appversion/ci'
-require 'appversion/git'
+require 'helpers/git'
+require 'helpers/ci'
+require 'appversion'
-
-RSpec.describe '#build_no' do
-
- include Overview
-
+RSpec.describe 'CI#build_no' do
it 'returns build number' do
build_no = ENV['TRAVIS_BUILD_NUMBER'] || ENV['CIRCLE_BUILD_NUM'] || '1'
- expect(Overview::CI.build_no).to eq(build_no)
+ expect(CI.build_no).to eq(build_no)
end
end
-RSpec.describe '#clean_tag' do
- it '1.2.3-rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2.3-rc4')).to eq('1.2.3')
+
+RSpec.describe 'Release#is_pre_release?' do
+ include AppVersion
+ it 'returns true' do
+ expect(AppVersion::Release.is_pre_release?('')).to eq(true)
end
- it '1.2-rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2-rc4')).to eq('1.2')
- end
- it '1.2-rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2-rc4')).to eq('1.2')
- end
- it '1.2.3 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2.3')).to eq('1.2.3')
- end
- it '1.2.3.4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2.3.4')).to eq('1.2.3')
- end
- it '1.2.rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2.rc4')).to eq('1.2')
- end
- it '1.2.3.rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.2.3.rc4')).to eq('1.2.3')
- end
- it '1.rc4 returns semantic version' do
- expect(Overview::Git.clean_tag('1.rc4')).to eq('1')
- end
- it '1 returns semantic version' do
- expect(Overview::Git.clean_tag('1')).to eq('1')
- end
end
-RSpec.describe '#tagged_build?' do
-
- include Overview
-
- it 'v0.0.3.5 returns true' do
- expect(Overview::CI.tagged_build?('v0.0.3.5')).to eq(true)
+=begin
+TODO: make these functions deterministic by passing in the tag
+RSpec.describe 'Git#tag' do
+ include AppVersion
+ it 'returns true' do
+ expect(Git.tag.length).to be > 1
end
- it 'EMPTY returns false' do
- expect(Overview::CI.tagged_build?('EMPTY')).to eq(false)
- end
-
end
-
-
-
+=end