Sha256: 77124510d260f5e9794e53154fa945917137092da62eb280758dd414983503e6

Contents?: true

Size: 1.51 KB

Versions: 72

Compression:

Stored size: 1.51 KB

Contents

# frozen_string_literal: true

require 'avm/git/launcher/base'

RSpec.describe ::Avm::Git::Launcher::Base do
  context 'new non-bare repository' do # rubocop:disable RSpec/ContextWording
    let(:repo) do
      r = described_class.new(::Dir.mktmpdir)
      r.git
      r
    end

    describe '#remote_exist?' do
      it { expect(repo.remote_exist?('origin')).to eq(false) }

      context 'after remote added' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
        before { repo.execute!('remote', 'add', 'origin', 'file:///path/to/remote') }

        it { expect(repo.remote_exist?('origin')).to eq(true) }

        context 'after remote removed' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
          before { repo.execute!('remote', 'remove', 'origin') }

          it { expect(repo.remote_exist?('origin')).to eq(false) }
        end
      end
    end

    describe '#assert_remote_url' do
      it { expect(repo.remote_exist?('origin')).to eq(false) }

      context 'after asserted remote URL "/remote1"' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
        before { repo.assert_remote_url('origin', '/remote1') }

        it { expect(repo.git.remote('origin').url).to eq('/remote1') }

        context 'after asserted remote URL "/remote2"' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
          before { repo.assert_remote_url('origin', '/remote2') }

          it { expect(repo.git.remote('origin').url).to eq('/remote2') }
        end
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
eac_tools-0.67.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.66.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.65.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.65.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.64.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.63.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.62.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.62.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.61.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.61.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.60.3 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.60.2 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.60.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.60.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.59.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.58.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.57.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.56.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.56.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.55.7 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb