spec/integration/push_spec.rb in braid-1.0.19 vs spec/integration/push_spec.rb in braid-1.0.20
- old
+ new
@@ -31,12 +31,13 @@
context 'with remote updtodate' do
it 'should push changes successfully' do
braid_output = nil
commit_message = 'Make some changes'
in_dir(@repository_dir) do
- set_editor_message(commit_message)
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1")
+ with_editor_message(commit_message) do
+ braid_output = run_command("#{BRAID_BIN} push skit1")
+ end
end
expect(braid_output).to match(/Braid: Cloning mirror with local changes./)
expect(braid_output).to match(/Make some changes/)
expect(braid_output).to match(/Braid: Pushing changes to remote branch master./)
@@ -54,12 +55,13 @@
it 'should push changes to specified branch successfully' do
commit_message = 'Make some changes'
braid_output = nil
in_dir(@repository_dir) do
- set_editor_message(commit_message)
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1 --branch MyBranch")
+ with_editor_message(commit_message) do
+ braid_output = run_command("#{BRAID_BIN} push skit1 --branch MyBranch")
+ end
end
expect(braid_output).to match(/Braid: Cloning mirror with local changes./)
expect(braid_output).to match(/Make some changes/)
expect(braid_output).to match(/Braid: Pushing changes to remote branch MyBranch./)
@@ -88,12 +90,13 @@
end
end
it 'should halt before attempting to push changes' do
braid_output = nil
in_dir(@repository_dir) do
- set_editor_message('Make some changes')
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1")
+ with_editor_message('Make some changes') do
+ braid_output = run_command("#{BRAID_BIN} push skit1")
+ end
end
expect(braid_output).to match(/Braid: Mirror is not up to date. Stopping./)
assert_no_diff("#{FIXTURE_PATH}/skit1.2/#{@file_name}", "#{TMP_PATH}/skit1/#{@file_name}")
end
@@ -124,12 +127,13 @@
context 'with remote updtodate' do
it 'should push changes successfully' do
braid_output = nil
commit_message = 'Make some changes'
in_dir(@repository_dir) do
- set_editor_message(commit_message)
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1")
+ with_editor_message(commit_message) do
+ braid_output = run_command("#{BRAID_BIN} push skit1")
+ end
end
expect(braid_output).to match(/Braid: Cloning mirror with local changes./)
expect(braid_output).to match(/Make some changes/)
expect(braid_output).to match(/Braid: Pushing changes to remote branch master./)
@@ -174,12 +178,13 @@
context 'with remote updtodate' do
it 'should fail tring to push without specifying branch' do
braid_output = nil
commit_message = 'Make some changes'
in_dir(@repository_dir) do
- set_editor_message(commit_message)
- braid_output = `#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1`
+ with_editor_message(commit_message) do
+ braid_output = `#{BRAID_BIN} push skit1`
+ end
end
expect(braid_output).to match(/Braid: Error: mirror is based off a tag. Can not push to a tag: skit1/)
assert_no_diff("#{FIXTURE_PATH}/skit1.1/#{@file_name}", "#{@repository_dir}/skit1/#{@file_name}")
assert_no_diff("#{FIXTURE_PATH}/skit1/#{@file_name}", "#{@vendor_repository_dir}/#{@file_name}")
@@ -187,12 +192,13 @@
it 'should push changes to specified branch successfully' do
commit_message = 'Make some changes'
braid_output = nil
in_dir(@repository_dir) do
- set_editor_message(commit_message)
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1 --branch MyBranch")
+ with_editor_message(commit_message) do
+ braid_output = run_command("#{BRAID_BIN} push skit1 --branch MyBranch")
+ end
end
expect(braid_output).to match(/Braid: Cloning mirror with local changes./)
expect(braid_output).to match(/Make some changes/)
expect(braid_output).to match(/Braid: Pushing changes to remote branch MyBranch./)
@@ -223,11 +229,12 @@
end
it 'should halt before attempting to push changes' do
braid_output = nil
in_dir(@repository_dir) do
- set_editor_message('Make some changes')
- braid_output = run_command("#{EDITOR_CMD_PREFIX} #{BRAID_BIN} push skit1 --branch MyBranch")
+ with_editor_message('Make some changes') do
+ braid_output = run_command("#{BRAID_BIN} push skit1 --branch MyBranch")
+ end
end
expect(braid_output).to match(/Braid: Mirror is not up to date. Stopping./)
assert_no_diff("#{FIXTURE_PATH}/skit1.2/#{@file_name}", "#{TMP_PATH}/skit1/#{@file_name}")
end