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

parallel_diff_spec.rb « diff « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 852218b4e62ce240844d6c66d7520254c375f18d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe Gitlab::Diff::ParallelDiff, lib: true do
  include RepoHelpers
  
  let(:project) { create(:project) }
  let(:repository) { project.repository }
  let(:commit) { project.commit(sample_commit.id) }
  let(:diffs) { commit.diffs }
  let(:diff) { diffs.first }
  let(:diff_refs) { [commit.parent, commit] }
  let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs) }
  subject { described_class.new(diff_file) }

  let(:parallel_diff_result_array) { YAML.load_file("#{Rails.root}/spec/fixtures/parallel_diff_result.yml") }

  describe '#parallelize' do
    it 'should return an array of arrays containing the parsed diff' do
      expect(subject.parallelize).to match_array(parallel_diff_result_array)
    end
  end
end