File: thin_repository.rb

package info (click to toggle)
r10k 5.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,228 kB
  • sloc: ruby: 18,180; makefile: 10; sh: 1
file content (26 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
RSpec.shared_examples "a git thin repository" do
  describe "cloning" do
    it "creates a working copy of the repo" do
      subject.clone(remote)
      expect(subject.exist?).to be_truthy
    end

    it "sets the remote origin url to the provided url" do
      subject.clone(remote)
      expect(subject.origin).to eq remote
    end

    it "sets the remote cache url to the path to the cache repo" do
      subject.clone(remote)
      expect(subject.cache).to eq cacherepo.git_dir.to_s
    end

    it "adds the cache repo to the alternates file" do
      subject.clone(remote)
      objectpath = cacherepo.git_dir + 'objects'
      alternates = subject.alternates.to_a
      expect(alternates.size).to eq 1
      expect(alternates[0]).to match_realpath objectpath
    end
  end
end