Sha256: 2d85c02d0f43da2fb9dff6af9da46ffd8f37231037d4db619b6506b8240fff81

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 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

RSpec.describe '#tagged_build?' do

  include Overview

  it 'returns true if TRAVIS_TAG is v0.0.3.5' do
    build_no = ENV['TRAVIS_BUILD_NUMBER'] || ENV['CIRCLE_BUILD_NUM'] || '1'
    expect(Overview::CI.tagged_build?('v0.0.3.5')).to eq(true)
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
overview-0.0.3.56 spec/appversion_spec.rb