2017-01-04 13:43:06 -05:00
|
|
|
# encoding: UTF-8
|
|
|
|
|
|
|
|
require "spec_helper"
|
|
|
|
|
2018-07-26 21:18:28 -04:00
|
|
|
describe Gitlab::Git::BlobSnippet, :seed_helper do
|
2017-03-24 19:04:03 -04:00
|
|
|
describe '#data' do
|
2017-01-04 13:43:06 -05:00
|
|
|
context 'empty lines' do
|
|
|
|
let(:snippet) { Gitlab::Git::BlobSnippet.new('master', nil, nil, nil) }
|
|
|
|
|
|
|
|
it { expect(snippet.data).to be_nil }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'present lines' do
|
2017-02-22 12:46:57 -05:00
|
|
|
let(:snippet) { Gitlab::Git::BlobSnippet.new('master', %w(wow much), 1, 'wow.rb') }
|
2017-01-04 13:43:06 -05:00
|
|
|
|
|
|
|
it { expect(snippet.data).to eq("wow\nmuch") }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|