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.80.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.79.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.78.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.77.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.77.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.76.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.76.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.75.2 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.75.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.75.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.74.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.74.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.73.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.72.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.70.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.70.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.69.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.69.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.68.0 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
eac_tools-0.67.1 sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb