Sha256: 3cb2fed5aa3cc5f0ac65b25f9590ac327962343d44549aacebaaf0da29295f83

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'
require 'appversion/ci'
require 'appversion/git'



RSpec.describe '#build_no' do

  include Overview

  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)
  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')
  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


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
overview-0.0.3.pre.debug.54 spec/appversion_spec.rb
overview-0.0.3.pre.debug.51 spec/appversion_spec.rb
overview-0.0.3.49 spec/appversion_spec.rb
overview-0.0.3.47 spec/appversion_spec.rb
overview-0.0.3.45 spec/appversion_spec.rb
overview-0.0.2.43 spec/appversion_spec.rb