Sha256: 992dedbaabc8eeee49da8392163d446904e943583f0cf1f6b0bced7da8c9cbec

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'anvil/versioner'

describe Anvil::Versioner do
  subject { described_class.new('1.2.3-alpha.1+build.2') }

  describe '#major!' do
    it 'bumps the major version and resets the others' do
      subject.major!.should == '2.0.0'
    end
  end

  describe '#minor!' do
    it 'bumps minor term and resets patch, pre and build' do
      subject.minor!.should == '1.3.0'
    end
  end

  describe '#patch!' do
    it 'bumps the patch term and resets the pre and build' do
      subject.patch!.should == '1.2.4'
    end
  end

  describe '#pre' do
    it 'bumps the pre-release version and resets the build' do
      subject.pre!.should == '1.2.3-alpha.2'
    end
  end

  describe '#build!' do
    it 'bumps the build version' do
      subject.build!.should == '1.2.3-alpha.1+build.3'
    end
  end

  describe '#increment!' do
    context 'if the term doesnt exist' do
      it 'raise an exception' do
        expect do
          subject.bump!(:foo)
        end.to raise_error(Anvil::Versioner::NotSupportedTerm)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
anvil-core-0.4.2 spec/lib/anvil/versioner_spec.rb
anvil-core-0.4.1 spec/lib/anvil/versioner_spec.rb
anvil-core-0.4.0 spec/lib/anvil/versioner_spec.rb
anvil-core-0.3.2 spec/lib/anvil/versioner_spec.rb
anvil-core-0.3.1 spec/lib/anvil/versioner_spec.rb
anvil-core-0.3.0 spec/lib/anvil/versioner_spec.rb
anvil-core-0.2.0 spec/lib/anvil/versioner_spec.rb
anvil-core-0.1.0 spec/lib/anvil/versioner_spec.rb
anvil-core-0.0.1.pre.alpha.3 spec/lib/anvil/versioner_spec.rb
anvil-core-0.0.1.pre.alpha.2 spec/lib/anvil/versioner_spec.rb