/
accept_spec.rb
50 lines (42 loc) · 1.3 KB
/
accept_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'spec_helper'
module Reviewr
module CLI
describe Accept do
let(:project){ double("Project").as_null_object }
let(:accept){ Accept.new(project) }
describe "#call" do
before do
accept.stub(:prompt_for_user)
accept.arguments = []
accept.output = double("Output").as_null_object
end
it "sets the review_branch" do
project.should_receive(:review_branch=).with("review_branch")
accept.arguments = ["review_branch"]
accept.call
end
it "prompts for user information" do
accept.should_receive(:prompt_for_user)
accept.call
end
it "fetches the remote branch" do
project.should_receive(:fetch_review_branch)
accept.call
end
it "fetches the remote master" do
project.should_receive(:fetch_master)
accept.call
end
it "creates a working branch for the reviewed code" do
project.should_receive(:create_review_branch).with("origin/review")
accept.arguments = ["review"]
accept.call
end
it "rebases the review branch on the master branch" do
project.should_receive(:rebase_review)
accept.call
end
end
end
end
end