Sha256: 64891fb4a3c2e46fa0a042c9e4895c1c092ff1894a5c9f2c83427ad432dded12

Contents?: true

Size: 889 Bytes

Versions: 5

Compression:

Stored size: 889 Bytes

Contents

require 'spec_helper'
require 'r10k/git/rugged/cache'

describe R10K::Git::Rugged::Cache, :if => R10K::Features.available?(:rugged) do
  include_context 'Git integration'

  let(:dirname) { 'working-repo' }
  let(:remote_name) { 'origin' }

  subject { described_class.new(remote) }

  context "syncing with the remote" do
    before(:each) do
      subject.reset!
    end

    describe "with the correct configuration" do
      it "is able to sync with the remote" do
        subject.sync
        expect(subject.synced?).to eq(true)
      end
    end

    describe "with a out of date cached remote" do
      it "updates the cached remote configuration" do
        subject.repo.update_remote('foo', remote_name)
        expect(subject.repo.remotes[remote_name]).to eq('foo')
        subject.sync
        expect(subject.repo.remotes[remote_name]).to eq(remote)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
r10k-3.15.0 spec/integration/git/rugged/cache_spec.rb
akerl-r10k-3.14.2.1 spec/integration/git/rugged/cache_spec.rb
r10k-3.14.2 spec/integration/git/rugged/cache_spec.rb
r10k-3.14.1 spec/integration/git/rugged/cache_spec.rb
r10k-3.14.0 spec/integration/git/rugged/cache_spec.rb