Sha256: f46b75452f3e8272dfba1a96e843a2cf2f1f93545b98b36ccae80c8430e339c9

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'
require 'r10k/git'

describe R10K::Git::Repository do
  include_context "fail on execution"

  describe "remotes" do
    let(:output) do
      "cache	/home/user/.r10k/git/git@github.com-org-org-modules (fetch)\n" +
      "cache	/home/user/.r10k/git/git@github.com-org-org-modules (push)\n" +
      "origin	git@github.com:org/org-modules (fetch)\n" +
      "origin	git@github.com:org/org-modules (push)\n"
    end

    it "generates a hash of remote names and remote URLs" do
      expect(subject).to receive(:git).with(%w[remote -v], anything).and_return(double(:stdout => output))

      expect(subject.remotes).to eq({
        'cache'  => '/home/user/.r10k/git/git@github.com-org-org-modules',
        'origin' => 'git@github.com:org/org-modules',
      })
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
r10k-1.3.0 spec/unit/git/repository_spec.rb
r10k-1.3.0rc1 spec/unit/git/repository_spec.rb
r10k-1.2.1 spec/unit/git/repository_spec.rb
r10k-1.2.0 spec/unit/git/repository_spec.rb