Commit 78d54274 authored by Eloy Duran's avatar Eloy Duran

Update spec repo fixture to latest 0.6 and fix CP version checking.

parent 378a4ae0
......@@ -64,9 +64,9 @@ module Pod
return unless yaml_file.exist?
data = YAML.load_file(yaml_file)
min_version = Gem::Version.new(data['min'])
max_version = Gem::Version.new(data['max'])
max_version = Gem::Version.new(data['max']) if data['max']
last_version = Gem::Version.new(data['last'])
if min_version > bin_version || max_version < bin_version
if min_version > bin_version || (max_version && max_version < bin_version)
version_msg = ( min_version == max_version ) ? min_version : "#{min_version} - #{max_version}"
raise Informative,
"\n[!] The `#{dir.basename.to_s}' repo requires CocoaPods #{min_version}\n".red +
......
......@@ -89,9 +89,12 @@ module Pod
else
add_master_repo_command.run
end
hook = config.repos_dir + 'master/.git/hooks/pre-commit'
hook.open('w') { |f| f << "#!/bin/sh\nrake lint" }
`chmod +x '#{hook}'`
# Mainly so the specs run with submodule repos
if (dir + '.git/hooks').exist?
hook = dir + '.git/hooks/pre-commit'
hook.open('w') { |f| f << "#!/bin/sh\nrake lint" }
`chmod +x '#{hook}'`
end
puts "Setup completed (#{push? ? "push" : "read-only"} access)" unless config.silent
end
end
......
Subproject commit 5f39221d0bf69ebc0a2dc5879deae271f208877b
Subproject commit dfa82b5f886ea11be0f81fb5a23167779d8b417f
......@@ -7,7 +7,12 @@ describe "Pod::Command::Setup" do
extend SpecHelper::TemporaryRepos
it "runs with correct parameters" do
lambda { run_command('setup') }.should.not.raise
begin
before, config.repos_dir = config.repos_dir, fixture('spec-repos')
lambda { run_command('setup') }.should.not.raise
ensure
config.repos_dir = before
end
end
it "complains for wrong parameters" do
......
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