Welcome to mirror list, hosted at ThFree Co, Russian Federation.

file_mover_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ba7cc033549d38908db83ab30b8f68556bcf0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

module FileMoverHelpers
  def stub_file_mover(file_path, stub_real_path: nil)
    file_name = File.basename(file_path)
    allow(Pathname).to receive(:new).and_call_original

    expect_next_instance_of(Pathname, a_string_including(file_name)) do |pathname|
      allow(pathname).to receive(:realpath) { stub_real_path || pathname.cleanpath }
    end
  end
end