Commit b5bdcea6 authored by Fabio Pelosin's avatar Fabio Pelosin

[Specs] Fix for incompatibility with current master repo.

parent 0ad82acd
......@@ -29,7 +29,6 @@ describe Pod::Command::Push do
it "it raises if the pod is not validated" do
repo1 = add_repo('repo1', master_repo)
git('repo1', 'checkout master') # checkout master, because the fixture is a submodule
repo2 = add_repo('repo2', repo1.dir)
git_config('repo2', 'remote.origin.url').should == (tmp_repos_path + 'repo1').to_s
Dir.chdir(fixture('banana-lib')) do
......@@ -41,10 +40,8 @@ describe Pod::Command::Push do
before do
# prepare the repos
@upstream = add_repo('upstream', master_repo)
git('upstream', 'checkout -b master') # checkout master, because the fixture is a submodule
@local_repo = add_repo('local_repo', @upstream.dir)
git_config('local_repo', 'remote.origin.url').should == (tmp_repos_path + 'upstream').to_s
git('upstream', 'checkout -b no-master') # checkout no-master, to allow push in a non-bare repository
# prepare the spec
spec_fix = (fixture('spec-repos') + 'master/JSONKit/1.4/JSONKit.podspec').read
......@@ -61,18 +58,19 @@ describe Pod::Command::Push do
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { lambda { cmd.run }.should.raise Pod::Informative }
git('upstream', 'checkout master') # checkout master, because the fixture is a submodule
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').should.not.exist?
end
it "sucessfully pushes a spec" do
git('upstream', 'checkout master') # checkout master, to allow push in a non-bare repository
cmd = command('push', 'local_repo')
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { cmd.run }
cmd.output.should.include('[Add] PushTest (1.4)')
cmd.output.should.include('[Fix] JSONKit (1.4)')
git('upstream', 'checkout master') # checkout master, because the fixture is a submodule
git('upstream', 'checkout test') # checkout because test because is it the branch used in the specs.
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
end
end
......@@ -23,7 +23,6 @@ describe "Pod::Command::Repo" do
it "updates a spec-repo" do
repo1 = add_repo('repo1', fixture('spec-repos/master'))
git('repo1', 'checkout master') # checkout master, because the fixture is a submodule
repo2 = add_repo('repo2', repo1.dir)
make_change(repo1, 'repo1')
run_command('repo', 'update', 'repo2')
......@@ -32,7 +31,6 @@ describe "Pod::Command::Repo" do
it "updates all the spec-repos" do
repo1 = add_repo('repo1', fixture('spec-repos/master'))
git('repo1', 'checkout master') # checkout master, because the fixture is a submodule
repo2 = add_repo('repo2', repo1.dir)
repo3 = add_repo('repo3', repo1.dir)
make_change(repo1, 'repo1')
......
......@@ -30,6 +30,7 @@ module SpecHelper
def add_repo(name, from)
command = command('repo', 'add', name, from)
command.run
Dir.chdir(command.dir) { `git checkout -b test >/dev/null 2>&1` }
command
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment