Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set gitconfig, hopefully fixing travis

  • Loading branch information...
commit 3d7fcaa17b2fffa831c546a10b791784eb152414 1 parent a7031aa
@indirect indirect authored
Showing with 16 additions and 22 deletions.
  1. +16 −22 spec/bundler/gem_helper_spec.rb
View
38 spec/bundler/gem_helper_spec.rb
@@ -128,6 +128,14 @@ def mock_build_message
end
describe 'release' do
+ before do
+ Dir.chdir(@app) do
+ `git init`
+ `git config user.email "you@example.com"`
+ `git config user.name "name"`
+ end
+ end
+
it "shouldn't push if there are unstaged files" do
expect { @helper.release_gem }.to raise_error(/files that need to be committed/)
end
@@ -140,15 +148,8 @@ def mock_build_message
it 'raises an appropriate error if there is no git remote' do
Bundler.ui.stub(:confirm => nil, :error => nil) # silence messages
- Dir.chdir(gem_repo1) {
- `git init --bare`
- }
- Dir.chdir(@app) {
- `git init`
- `git config user.email "you@example.com"`
- `git config user.name "name"`
- `git commit -a -m "initial commit"`
- }
+ Dir.chdir(gem_repo1) { `git init --bare` }
+ Dir.chdir(@app) { `git commit -a -m "initial commit"` }
expect { @helper.release_gem }.to raise_error
end
@@ -160,18 +161,13 @@ def mock_build_message
@helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
- Dir.chdir(gem_repo1) {
- `git init --bare`
- }
- Dir.chdir(@app) {
- `git init`
- `git config user.email "you@example.com"`
- `git config user.name "name"`
+ Dir.chdir(gem_repo1) { `git init --bare` }
+ Dir.chdir(@app) do
`git remote add origin file://#{gem_repo1}`
`git commit -a -m "initial commit"`
sys_exec("git push origin master", true)
`git commit -a -m "another commit"`
- }
+ end
@helper.release_gem
end
@@ -181,13 +177,11 @@ def mock_build_message
@helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
- Dir.chdir(gem_repo1) {
- `git init --bare`
- }
- Dir.chdir(@app) {
+ Dir.chdir(gem_repo1) { `git init --bare` }
+ Dir.chdir(@app) do
`git commit -a -m "another commit"`
`git tag -a -m \"Version 0.0.1\" v0.0.1`
- }
+ end
@helper.release_gem
end
Please sign in to comment.
Something went wrong with that request. Please try again.