debian-mirror-gitlab/spec/lib/gitlab/git/util_spec.rb
2020-08-09 17:41:57 +05:30

18 lines
394 B
Ruby

# frozen_string_literal: true
require '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