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

changed_path_spec.rb « git « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93db107ad5ceee0d873efb2bd144b1c5988036aa (plain)
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
27
28
29
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Gitlab::Git::ChangedPath do
  subject(:changed_path) { described_class.new(path: path, status: status) }

  let(:path) { 'test_path' }

  describe '#new_file?' do
    subject(:new_file?) { changed_path.new_file? }

    context 'when it is a new file' do
      let(:status) { :ADDED }

      it 'returns true' do
        expect(new_file?).to eq(true)
      end
    end

    context 'when it is not a new file' do
      let(:status) { :MODIFIED }

      it 'returns false' do
        expect(new_file?).to eq(false)
      end
    end
  end
end