BigW Consortium Gitlab

util_spec.rb 357 Bytes
Newer Older
Robert Speicher committed
1 2 3
require 'spec_helper'

describe Gitlab::Git::Util do
4
  describe '#count_lines' do
Robert Speicher committed
5 6 7 8
    [
      ["", 0],
      ["foo", 1],
      ["foo\n", 1],
9
      ["foo\n\n", 2]
Robert Speicher committed
10 11
    ].each do |string, line_count|
      it "counts #{line_count} lines in #{string.inspect}" do
12
        expect(described_class.count_lines(string)).to eq(line_count)
Robert Speicher committed
13 14 15 16
      end
    end
  end
end