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

util_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: dd925a902aba3c4e8ccdb456d7878f897ee32613 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Git::Util do
  describe '#count_lines' do
    [
      ["", 0],
      ["foo", 1],
      ["foo\n", 1],
      ["foo\n\n", 2]
    ].each do |string, line_count|
      it "counts #{line_count} lines in #{string.inspect}" do
        expect(described_class.count_lines(string)).to eq(line_count)
      end
    end
  end
end