debian-mirror-gitlab/spec/lib/gitlab/git/util_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
394 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::Git::Util do
2017-08-17 22:00:37 +05:30
describe '#count_lines' do
[
["", 0],
["foo", 1],
["foo\n", 1],
2017-09-10 17:25:29 +05:30
["foo\n\n", 2]
2017-08-17 22:00:37 +05:30
].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