2014-09-08 13:42:12 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Diff::File do
|
|
|
|
include RepoHelpers
|
|
|
|
|
|
|
|
let(:project) { create(:project) }
|
2015-04-21 09:13:40 -04:00
|
|
|
let(:commit) { project.commit(sample_commit.id) }
|
2014-09-08 13:42:12 -04:00
|
|
|
let(:diff) { commit.diffs.first }
|
2014-09-08 14:54:52 -04:00
|
|
|
let(:diff_file) { Gitlab::Diff::File.new(diff) }
|
2014-09-08 13:42:12 -04:00
|
|
|
|
|
|
|
describe :diff_lines do
|
|
|
|
let(:diff_lines) { diff_file.diff_lines }
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { expect(diff_lines.size).to eq(30) }
|
|
|
|
it { expect(diff_lines.first).to be_kind_of(Gitlab::Diff::Line) }
|
2014-09-08 13:42:12 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe :mode_changed? do
|
2015-02-12 13:17:35 -05:00
|
|
|
it { expect(diff_file.mode_changed?).to be_falsey }
|
2014-09-08 13:42:12 -04:00
|
|
|
end
|
|
|
|
end
|