Permalink
Browse files

[Specs] fix for the fix that was supposed to fix Travis.

  • Loading branch information...
fabiopelosin committed Sep 19, 2012
1 parent d370ca2 commit d94da4bcfdb2660da58b9499f70e3fe4e8d09582
Showing with 56 additions and 55 deletions.
  1. +53 −53 spec/functional/command/repo_spec.rb
  2. +3 −2 spec/spec_helper/temporary_repos.rb
@@ -6,59 +6,59 @@
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
- # it "runs with correct parameters" do
- # lambda { run_command('repo', 'update') }.should.not.raise
- # lambda { run_command('repo', 'lint', temporary_directory.to_s) }.should.not.raise
- # end
-
- # it "complains for wrong parameters" do
- # lambda { run_command('repo', 'add') }.should.raise Pod::Informative
- # lambda { run_command('repo', 'add', 'NAME') }.should.raise Pod::Informative
- # end
-
- # it "adds a spec-repo" do
- # run_command('repo', 'add', 'private', fixture('spec-repos/master'))
- # git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
- # end
-
- # it "adds a spec-repo with on a specified branch" do
- # repo1 = add_repo('repo1', fixture('spec-repos/master'))
- # Dir.chdir(repo1.dir) do
- # `git checkout -b my-branch >/dev/null 2>&1`
- # `git checkout master >/dev/null 2>&1`
- # end
- # repo2 = command( 'repo' ,'add', 'repo2', repo1.dir, 'my-branch')
- # repo2.run
- # Dir.chdir(repo2.dir) { `git symbolic-ref HEAD` }.should.include? 'my-branch'
- # end
-
- # it "updates a spec-repo" do
- # repo1 = add_repo('repo1', fixture('spec-repos/master'))
- # repo2 = add_repo('repo2', repo1.dir)
- # make_change(repo1, 'repo1')
- # run_command('repo', 'update', 'repo2')
- # (repo2.dir + 'README').read.should.include 'Added!'
- # end
-
- # it "updates all the spec-repos" do
- # repo1 = add_repo('repo1', fixture('spec-repos/master'))
- # repo2 = add_repo('repo2', repo1.dir)
- # repo3 = add_repo('repo3', repo1.dir)
- # make_change(repo1, 'repo1')
- # run_command('repo', 'update')
- # (repo2.dir + 'README').read.should.include 'Added!'
- # (repo3.dir + 'README').read.should.include 'Added!'
- # end
-
- # before do
- # config.repos_dir = fixture('spec-repos')
- # end
-
- # it "lints a repo" do
- # cmd = command('repo', 'lint', 'master')
- # lambda { cmd.run }.should.raise Pod::Informative
- # cmd.output.should.include "Missing license type"
- # end
+ it "runs with correct parameters" do
+ lambda { run_command('repo', 'update') }.should.not.raise
+ lambda { run_command('repo', 'lint', temporary_directory.to_s) }.should.not.raise
+ end
+
+ it "complains for wrong parameters" do
+ lambda { run_command('repo', 'add') }.should.raise Pod::Informative
+ lambda { run_command('repo', 'add', 'NAME') }.should.raise Pod::Informative
+ end
+
+ it "adds a spec-repo" do
+ run_command('repo', 'add', 'private', fixture('spec-repos/master'))
+ git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
+ end
+
+ it "adds a spec-repo with on a specified branch" do
+ repo1 = add_repo('repo1', fixture('spec-repos/master'))
+ Dir.chdir(repo1.dir) do
+ `git checkout -b my-branch >/dev/null 2>&1`
+ `git checkout master >/dev/null 2>&1`
+ end
+ repo2 = command( 'repo' ,'add', 'repo2', repo1.dir, 'my-branch')
+ repo2.run
+ Dir.chdir(repo2.dir) { `git symbolic-ref HEAD` }.should.include? 'my-branch'
+ end
+
+ it "updates a spec-repo" do
+ repo1 = add_repo('repo1', fixture('spec-repos/master'))
+ repo2 = add_repo('repo2', repo1.dir)
+ make_change(repo1, 'repo1')
+ run_command('repo', 'update', 'repo2')
+ (repo2.dir + 'README').read.should.include 'Added!'
+ end
+
+ it "updates all the spec-repos" do
+ repo1 = add_repo('repo1', fixture('spec-repos/master'))
+ repo2 = add_repo('repo2', repo1.dir)
+ repo3 = add_repo('repo3', repo1.dir)
+ make_change(repo1, 'repo1')
+ run_command('repo', 'update')
+ (repo2.dir + 'README').read.should.include 'Added!'
+ (repo3.dir + 'README').read.should.include 'Added!'
+ end
+
+ before do
+ config.repos_dir = fixture('spec-repos')
+ end
+
+ it "lints a repo" do
+ cmd = command('repo', 'lint', 'master')
+ lambda { cmd.run }.should.raise Pod::Informative
+ cmd.output.should.include "Missing license type"
+ end
end
describe "Concerning a repo support" do
@@ -30,9 +30,10 @@ def git_config(repo, attr)
def add_repo(name, from)
command = command('repo', 'add', name, from)
command.run
+ # The test branch is used by the push specs
Dir.chdir(command.dir) do
- `git checkout -b master >/dev/null 2>&1`
- `git branch --set-upstream master origin/master >/dev/null 2>&1`
+ `git checkout -b test >/dev/null 2>&1`
+ `git branch --set-upstream test origin/master >/dev/null 2>&1`
end
command
end

0 comments on commit d94da4b

Please sign in to comment.