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

blob_snippet_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: 17d6be470aca5635eeb898c4414d96707ab81a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# encoding: UTF-8

require "spec_helper"

describe Gitlab::Git::BlobSnippet, seed_helper: true do
  describe :data do
    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
      let(:snippet) { Gitlab::Git::BlobSnippet.new('master', %w(wow much), 1, 'wow.rb') }

      it { expect(snippet.data).to eq("wow\nmuch") }
    end
  end
end