summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/kubernetes/pod_cmd_spec.rb
blob: 51bdbf64741ca298157c48d30bdd66d90820f36c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Kubernetes::PodCmd do
  describe '.retry_command' do
    it 'constructs string properly' do
      command = 'my command'
      command_with_retries = "for i in $(seq 1 3); do #{command} && s=0 && break || s=$?; sleep 1s; echo \"Retrying ($i)...\"; done; (exit $s)"

      expect(described_class.retry_command(command)).to eq command_with_retries
    end
  end
end