Sha256: 8501ffe7ef0915309519c56d10d8e4a5e84be0fa485d65c62591afd220d66baf

Contents?: true

Size: 1.46 KB

Versions: 14

Compression:

Stored size: 1.46 KB

Contents

require 'spec_helper'

describe Targit do
  describe Targit::Release do
    let(:basic_release) do
      VCR.use_cassette('release_object') do
        Targit::Release.new 'akerl/targit', 'testing', authfile: 'spec/.creds'
      end
    end

    it 'exposes the release object' do
      expect(basic_release.data[:tag_name]).to eql 'testing'
    end
    it 'exposes the repo name' do
      expect(basic_release.repo).to eql 'akerl/targit'
    end
    it 'exposes the tag name' do
      expect(basic_release.tag).to eql 'testing'
    end

    it 'does not create a new release by default' do
      VCR.use_cassette('no_release_found') do
        expect do
          Targit::Release.new(
            'akerl/targit', 'new_release', authfile: 'spec/.creds'
          )
        end.to raise_error RuntimeError, /No release found/
      end
    end

    it 'creates the repo if called with :create = true' do
      VCR.use_cassette('create_new_release') do
        release = Targit::Release.new(
          'akerl/targit', 'new_release', create: true, authfile: 'spec/.creds'
        )
        expect(release.repo).to eql 'akerl/targit'
      end
    end

    it 'uses the provided release name if given' do
      VCR.use_cassette('create_named_release') do
        release = Targit::Release.new(
          'akerl/targit',
          'new_release',
          create: 'special',
          authfile: 'spec/.creds'
        )
        expect(release.data[:name]).to eql 'special'
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
targit-2.2.0 spec/targit/release_spec.rb
targit-2.1.0 spec/targit/release_spec.rb
targit-2.0.2 spec/targit/release_spec.rb
targit-2.0.1 spec/targit/release_spec.rb
targit-2.0.0 spec/targit/release_spec.rb
targit-1.1.0 spec/targit/release_spec.rb
targit-1.0.1 spec/targit/release_spec.rb
targit-1.0.0 spec/targit/release_spec.rb
targit-0.2.0 spec/targit/release_spec.rb
targit-0.1.5 spec/targit/release_spec.rb
targit-0.1.4 spec/targit/release_spec.rb
targit-0.1.3 spec/targit/release_spec.rb
targit-0.1.2 spec/targit/release_spec.rb
targit-0.1.1 spec/targit/release_spec.rb