|
4 | 4 |
|
5 | 5 | describe Overcommit::Hook::PrePush::Base do
|
6 | 6 | let(:remote_name) { 'origin' }
|
7 |
| - let(:remote_branch_deletion?) { false } |
| 7 | + let(:remote_ref_deletion?) { false } |
8 | 8 | let(:config) { double('config') }
|
9 | 9 | let(:context) { double('context') }
|
10 | 10 | let(:hook) { described_class.new(config, context) }
|
|
14 | 14 |
|
15 | 15 | before do
|
16 | 16 | allow(context).to receive(:remote_name).and_return(remote_name)
|
17 |
| - allow(context).to receive(:remote_branch_deletion?).and_return(remote_branch_deletion?) |
| 17 | + allow(context).to receive(:remote_ref_deletion?).and_return(remote_ref_deletion?) |
18 | 18 | allow(config).to receive(:for_hook).and_return(hook_config)
|
19 | 19 | end
|
20 | 20 |
|
|
44 | 44 | end
|
45 | 45 | end
|
46 | 46 |
|
47 |
| - context 'with include_branch_deletions specified' do |
| 47 | + context 'with include_remote_ref_deletions specified' do |
48 | 48 | let(:hook_config) do
|
49 |
| - { 'include_branch_deletions' => include_branch_deletions } |
| 49 | + { 'include_remote_ref_deletions' => include_remote_ref_deletions } |
50 | 50 | end
|
51 |
| - let(:remote_branch_deletion?) { false } |
52 |
| - let(:include_branch_deletions) { false } |
| 51 | + let(:remote_ref_deletion?) { false } |
| 52 | + let(:include_remote_ref_deletions) { false } |
53 | 53 |
|
54 | 54 | context 'when remote branch is not being deleted' do
|
55 |
| - let(:remote_branch_deletion?) { false } |
| 55 | + let(:remote_ref_deletion?) { false } |
56 | 56 |
|
57 |
| - context 'when include_branch_deletions is not specified' do |
58 |
| - let(:include_branch_deletions) { nil } |
| 57 | + context 'when include_remote_ref_deletions is not specified' do |
| 58 | + let(:include_remote_ref_deletions) { nil } |
59 | 59 |
|
60 | 60 | it { subject.should == true }
|
61 | 61 | end
|
62 | 62 |
|
63 |
| - context 'when include_branch_deletions is false' do |
64 |
| - let(:include_branch_deletions) { false } |
| 63 | + context 'when include_remote_ref_deletions is false' do |
| 64 | + let(:include_remote_ref_deletions) { false } |
65 | 65 |
|
66 | 66 | it { subject.should == true }
|
67 | 67 | end
|
68 | 68 |
|
69 |
| - context 'when include_branch_deletions is true' do |
70 |
| - let(:include_branch_deletions) { true } |
| 69 | + context 'when include_remote_ref_deletions is true' do |
| 70 | + let(:include_remote_ref_deletions) { true } |
71 | 71 |
|
72 | 72 | it { subject.should == true }
|
73 | 73 | end
|
74 | 74 | end
|
75 | 75 |
|
76 | 76 | context 'when remote branch is being deleted' do
|
77 |
| - let(:remote_branch_deletion?) { true } |
| 77 | + let(:remote_ref_deletion?) { true } |
78 | 78 |
|
79 |
| - context 'when include_branch_deletions is not specified' do |
80 |
| - let(:include_branch_deletions) { nil } |
| 79 | + context 'when include_remote_ref_deletions is not specified' do |
| 80 | + let(:include_remote_ref_deletions) { nil } |
81 | 81 |
|
82 | 82 | it { subject.should == false }
|
83 | 83 | end
|
84 | 84 |
|
85 |
| - context 'when include_branch_deletions is false' do |
86 |
| - let(:include_branch_deletions) { false } |
| 85 | + context 'when include_remote_ref_deletions is false' do |
| 86 | + let(:include_remote_ref_deletions) { false } |
87 | 87 |
|
88 | 88 | it { subject.should == false }
|
89 | 89 | end
|
90 | 90 |
|
91 |
| - context 'when include_branch_deletions is true' do |
92 |
| - let(:include_branch_deletions) { true } |
| 91 | + context 'when include_remote_ref_deletions is true' do |
| 92 | + let(:include_remote_ref_deletions) { true } |
93 | 93 |
|
94 | 94 | it { subject.should == true }
|
95 | 95 | end
|
|
0 commit comments