Sha256: 167b03bc602408dd8f68f8f11f3d0a185eb376407324e516fd0bae28b5edb30b
Contents?: true
Size: 1.02 KB
Versions: 17
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' RSpec.describe Loga::ServiceVersionStrategies do describe '#call' do context 'when GIT is available' do before do allow(described_class::SCM_GIT).to receive(:call).and_return("2776b9c\n") end it 'returns the git sha' do expect(subject.call).to eql('2776b9c') end end context 'when REVISION file is available' do before do allow(described_class::SCM_GIT).to receive(:call).and_return(nil) allow(File).to receive(:read).with('REVISION').and_return("2776b9c\n") end it 'returns the file content' do expect(subject.call).to eql('2776b9c') end end context 'when both GIT and REVISION file are unavailable' do before do allow(described_class::SCM_GIT).to receive(:call).and_return(nil) allow(described_class::REVISION_FILE).to receive(:call).and_return(nil) end it 'returns a default value' do expect(subject.call).to eql('unknown.sha') end end end end
Version data entries
17 entries across 17 versions & 1 rubygems