git_reflow 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +348 -348
- data/Gemfile.lock +13 -15
- data/LICENSE +20 -20
- data/README.rdoc +461 -461
- data/Rakefile +8 -8
- data/bin/console +7 -7
- data/bin/setup +6 -6
- data/circle.yml +5 -5
- data/exe/git-reflow +36 -36
- data/git_reflow.gemspec +1 -1
- data/lib/git_reflow/commands/deliver.rb +10 -10
- data/lib/git_reflow/commands/refresh.rb +20 -20
- data/lib/git_reflow/commands/review.rb +13 -13
- data/lib/git_reflow/commands/setup.rb +11 -11
- data/lib/git_reflow/commands/stage.rb +9 -9
- data/lib/git_reflow/commands/start.rb +22 -22
- data/lib/git_reflow/commands/status.rb +7 -7
- data/lib/git_reflow/config.rb +9 -9
- data/lib/git_reflow/git_server/base.rb +68 -68
- data/lib/git_reflow/git_server/bit_bucket/pull_request.rb +84 -84
- data/lib/git_reflow/git_server/bit_bucket.rb +101 -101
- data/lib/git_reflow/git_server/git_hub/pull_request.rb +4 -1
- data/lib/git_reflow/git_server/pull_request.rb +11 -2
- data/lib/git_reflow/git_server.rb +63 -63
- data/lib/git_reflow/logger.rb +49 -0
- data/lib/git_reflow/merge_error.rb +9 -9
- data/lib/git_reflow/os_detector.rb +23 -23
- data/lib/git_reflow/rspec/command_line_helpers.rb +12 -8
- data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
- data/lib/git_reflow/rspec.rb +2 -2
- data/lib/git_reflow/sandbox.rb +11 -6
- data/lib/git_reflow/version.rb +1 -1
- data/lib/git_reflow/workflow.rb +59 -59
- data/lib/git_reflow/workflows/core.rb +238 -238
- data/lib/git_reflow/workflows/flat_merge.rb +10 -10
- data/lib/git_reflow.rb +11 -0
- data/spec/fixtures/awesome_workflow.rb +7 -0
- data/spec/fixtures/git/git_config +7 -0
- data/spec/fixtures/issues/comment.json.erb +27 -0
- data/spec/fixtures/issues/comments.json +29 -0
- data/spec/fixtures/issues/comments.json.erb +15 -0
- data/spec/fixtures/pull_requests/comment.json.erb +45 -0
- data/spec/fixtures/pull_requests/comments.json +47 -0
- data/spec/fixtures/pull_requests/comments.json.erb +15 -0
- data/spec/fixtures/pull_requests/commits.json +29 -0
- data/spec/fixtures/pull_requests/external_pull_request.json +145 -0
- data/spec/fixtures/pull_requests/pull_request.json +142 -0
- data/spec/fixtures/pull_requests/pull_request.json.erb +142 -0
- data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -0
- data/spec/fixtures/pull_requests/pull_requests.json +136 -0
- data/spec/fixtures/repositories/commit.json +53 -0
- data/spec/fixtures/repositories/commit.json.erb +53 -0
- data/spec/fixtures/repositories/commits.json.erb +13 -0
- data/spec/fixtures/repositories/statuses.json +31 -0
- data/spec/fixtures/workflow_with_super.rb +8 -0
- data/spec/lib/git_reflow/config_spec.rb +74 -0
- data/spec/lib/git_reflow/git_helpers_spec.rb +182 -0
- data/spec/lib/git_reflow/git_server/bit_bucket_spec.rb +81 -0
- data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +587 -0
- data/spec/lib/git_reflow/git_server/git_hub_spec.rb +221 -0
- data/spec/lib/git_reflow/git_server/pull_request_spec.rb +524 -0
- data/spec/lib/git_reflow/git_server_spec.rb +101 -0
- data/spec/lib/git_reflow/logger_spec.rb +18 -0
- data/spec/lib/git_reflow/sandbox_spec.rb +15 -0
- data/spec/lib/git_reflow/workflow_spec.rb +59 -0
- data/spec/lib/git_reflow/workflows/core_spec.rb +665 -0
- data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +59 -0
- data/spec/lib/git_reflow_spec.rb +75 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/fake_github.rb +128 -0
- data/spec/support/fixtures.rb +54 -0
- data/spec/support/github_helpers.rb +109 -0
- data/spec/support/mock_pull_request.rb +17 -0
- data/spec/support/web_mocks.rb +39 -0
- metadata +83 -6
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GitReflow::Workflow do
|
4
|
+
|
5
|
+
class DummyWorkflow
|
6
|
+
include GitReflow::Workflow
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:workflow) { DummyWorkflow }
|
10
|
+
let(:loader) { double() }
|
11
|
+
|
12
|
+
describe ".current" do
|
13
|
+
subject { GitReflow::Workflow.current }
|
14
|
+
|
15
|
+
context "when no workflow is set" do
|
16
|
+
before { allow(GitReflow::Config).to receive(:get).with("reflow.workflow").and_return('') }
|
17
|
+
specify { expect( subject ).to eql(GitReflow::Workflows::Core) }
|
18
|
+
end
|
19
|
+
|
20
|
+
context "when a workflow is set" do
|
21
|
+
let(:workflow_path) { File.join(File.expand_path("../../../fixtures", __FILE__), "/awesome_workflow.rb") }
|
22
|
+
|
23
|
+
before { allow(GitReflow::Config).to receive(:get).with("reflow.workflow").and_return(workflow_path) }
|
24
|
+
specify { expect( subject ).to eql(GitReflow::Workflow::AwesomeWorkflow) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe ".command" do
|
29
|
+
it "creates a class method for a bogus command" do
|
30
|
+
class DummyWorkflow
|
31
|
+
include GitReflow::Workflow
|
32
|
+
end
|
33
|
+
workflow.command :bogus do
|
34
|
+
"Woohoo"
|
35
|
+
end
|
36
|
+
|
37
|
+
expect(DummyWorkflow.bogus).to eql("Woohoo")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "creates a method for a bogus command with arguments" do
|
41
|
+
workflow.command :bogus, arguments: [:feature_branch] do |**params|
|
42
|
+
"Woohoo #{params[:feature_branch]}!"
|
43
|
+
end
|
44
|
+
|
45
|
+
expect(DummyWorkflow.bogus(feature_branch: "donuts")).to eql("Woohoo donuts!")
|
46
|
+
end
|
47
|
+
|
48
|
+
it "creates a class method for a bogus command with default options" do
|
49
|
+
workflow.command :bogus, arguments: [:feature_branch], defaults: {decoration: 'sprinkles'} do |**params|
|
50
|
+
donut_excitement = "Woohoo #{params[:feature_branch]}"
|
51
|
+
donut_excitement += " with #{params[:decoration]}" if params[:decoration]
|
52
|
+
"#{donut_excitement}!"
|
53
|
+
end
|
54
|
+
|
55
|
+
expect(DummyWorkflow.bogus(feature_branch: "donuts")).to eql("Woohoo donuts with sprinkles!")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|