mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-16 14:24:09 +02:00
Fix branch spec for new git gem behaviour
This commit is contained in:
parent
c84bb954b9
commit
6cd961c75d
2 changed files with 9 additions and 5 deletions
|
@ -16,8 +16,8 @@ RSpec.describe "Branch Popup", :git, :nvim do
|
|||
|
||||
describe "branch.<current>.{merge,remote}" do
|
||||
it "can set the upstream for current branch" do
|
||||
expect(git.config("branch.#{git.branch.name}.remote")).to eq("")
|
||||
expect(git.config("branch.#{git.branch.name}.merge")).to eq("")
|
||||
expect_git_failure { git.config("branch.#{git.branch.name}.remote") }
|
||||
expect_git_failure { git.config("branch.#{git.branch.name}.merge") }
|
||||
|
||||
nvim.keys("bumaster<cr>")
|
||||
expect(git.config("branch.#{git.branch.name}.remote")).to eq(".")
|
||||
|
@ -29,20 +29,20 @@ RSpec.describe "Branch Popup", :git, :nvim do
|
|||
before { git.config("pull.rebase", "false") }
|
||||
|
||||
it "can change rebase setting" do
|
||||
expect(git.config("branch.#{git.branch.name}.rebase")).to eq("")
|
||||
expect_git_failure { git.config("branch.#{git.branch.name}.rebase") }
|
||||
expect(git.config("pull.rebase")).to eq("false")
|
||||
nvim.keys("bR")
|
||||
expect(git.config("branch.#{git.branch.name}.rebase")).to eq("true")
|
||||
nvim.keys("R")
|
||||
expect(git.config("branch.#{git.branch.name}.rebase")).to eq("false")
|
||||
nvim.keys("R")
|
||||
expect(git.config("branch.#{git.branch.name}.rebase")).to eq("")
|
||||
expect_git_failure { git.config("branch.#{git.branch.name}.rebase") }
|
||||
end
|
||||
end
|
||||
|
||||
describe "branch.<current>.pushRemote", :with_remote_origin do
|
||||
it "can change pushRemote for current branch" do
|
||||
expect(git.config("branch.master.pushRemote")).to eq("")
|
||||
expect_git_failure { git.config("branch.master.pushRemote") }
|
||||
nvim.keys("bp")
|
||||
expect(git.config("branch.master.pushRemote")).to eq("origin")
|
||||
end
|
||||
|
|
|
@ -5,6 +5,10 @@ module Helpers
|
|||
File.write(File.join(Dir.pwd, filename), content)
|
||||
end
|
||||
|
||||
def expect_git_failure(&)
|
||||
expect(&).to raise_error(Git::FailedError)
|
||||
end
|
||||
|
||||
# def wait_for_expect
|
||||
# last_error = nil
|
||||
# success = false
|
||||
|
|
Loading…
Reference in a new issue