-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will allow us to add new functionality aside from rebasing branches.
- Loading branch information
Showing
7 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
require_relative "../lib/baes" | ||
|
||
Baes::Actions::Rebase.call(ARGV) | ||
Baes::Actions::Run.call(ARGV) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
# top-level class to parse options and run the command | ||
module Baes::Actions::Run | ||
# parse options and execute command | ||
def self.call(options) | ||
Baes::Actions::LoadConfiguration.call(options) | ||
|
||
Baes::Actions::Rebase.call | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Baes::Actions::Run do | ||
describe ".call" do | ||
it "loads configuration" do | ||
FakeGit.branch_names = ["main", "my_branch"] | ||
options = ["--dry-run"] | ||
|
||
described_class.call(options) | ||
|
||
expect(Baes::Configuration.dry_run?).to be(true) | ||
end | ||
|
||
it "rebases branches" do | ||
FakeGit.branch_names = ["main", "my_branch"] | ||
|
||
described_class.call([]) | ||
|
||
expect(FakeGit.rebases).to eq([["my_branch", "main"]]) | ||
end | ||
end | ||
end |