Sha256: fd793d53d23ce9fe1e451235b82d07153835c80924a7df27af0129eb34560dc7

Contents?: true

Size: 1.29 KB

Versions: 20

Compression:

Stored size: 1.29 KB

Contents

require "spec_helper"
require "gitlab_exporter"

# rubocop:disable Metrics/LineLength
describe GitLab::Exporter::GitProcessProber do
  describe ".extract_subcommand" do
    it "extract git subcommand" do
      command_subcommands = {
        "git upload-pack --stateless-rpc --advertise-refs /repositories/Hey/project.git" => "upload-pack",
        "git --git-dir=/repositories/null/gitlab-ce.git fetch upstream --tags" => "fetch",
        "git --shallow-file  pack-objects --revs --thin --stdout --shallow --delta-base-offset" => "pack-objects",
        "git /repositories/some/thing.git pack-objects" => "pack-objects",
        "git --git-dir=/repositories/Fact/arti.git cat-file blob 13b39ff4503badb8182b901c471039d6ab6ab96b" => "cat-file",
        "git --git-dir /repositories/Fact/arti.git cat-file blob 13b39ff4503badb8182b901c471039d6ab6ab96b" => "cat-file",
        "git --git-dir=/repositories/an/web.git gc" => "gc",
        "git --git-dir=/repositories/an/web.git  gc" => "gc",
        "git --git-dir /repositories/an/web.git gc" => "gc",
        "git --git-dir /repositories/an/web.git" => nil
      }

      command_subcommands.each do |command, subcommand|
        cmdline = command.tr(" ", "\u0000")
        expect(described_class.extract_subcommand(cmdline)).to eq(subcommand)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
gitlab-exporter-8.0.0 spec/git_process_proper_spec.rb
gitlab-exporter-7.2.0 spec/git_process_proper_spec.rb
gitlab-exporter-7.1.2 spec/git_process_proper_spec.rb
gitlab-exporter-7.1.1 spec/git_process_proper_spec.rb
gitlab-exporter-7.1.0 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.6 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.5 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.4 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.3 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.2 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.1 spec/git_process_proper_spec.rb
gitlab-exporter-7.0.0 spec/git_process_proper_spec.rb
gitlab-exporter-6.1.0 spec/git_process_proper_spec.rb
gitlab-exporter-6.0.0 spec/git_process_proper_spec.rb
gitlab-exporter-5.2.2 spec/git_process_proper_spec.rb
gitlab-exporter-5.2.1 spec/git_process_proper_spec.rb
gitlab-exporter-5.2.0 spec/git_process_proper_spec.rb
gitlab-exporter-5.1.0 spec/git_process_proper_spec.rb
gitlab-exporter-5.0.1 spec/git_process_proper_spec.rb
gitlab-exporter-5.0.0 spec/git_process_proper_spec.rb