Commit 7d3fb0cc authored by Eloy Durán's avatar Eloy Durán

[spec] Disable tests that require mercurial to be installed if it's not.

You'll see output at the end of a run like:

```
[!] Skipping test due to missing `hg` executable: Installs a Pod with different subspecs activated across different targets

[!] Skipping test due to missing `hg` executable: Installs a Pod with an external source
```
parent e68500b1
...@@ -91,6 +91,8 @@ end ...@@ -91,6 +91,8 @@ end
describe_cli 'pod' do describe_cli 'pod' do
has_mercurial = system('which hg')
subject do |s| subject do |s|
s.executable = "ruby #{ROOT + 'bin/pod'}" s.executable = "ruby #{ROOT + 'bin/pod'}"
s.environment_vars = { s.environment_vars = {
...@@ -104,7 +106,7 @@ describe_cli 'pod' do ...@@ -104,7 +106,7 @@ describe_cli 'pod' do
] ]
s.replace_path ROOT.to_s, 'ROOT' s.replace_path ROOT.to_s, 'ROOT'
s.replace_path `which git`.chomp, 'GIT_BIN' s.replace_path `which git`.chomp, 'GIT_BIN'
s.replace_path `which hg`.chomp, 'HG_BIN' s.replace_path `which hg`.chomp, 'HG_BIN' if has_mercurial
s.replace_user_path 'Library/Caches/CocoaPods', 'CACHES_DIR' s.replace_user_path 'Library/Caches/CocoaPods', 'CACHES_DIR'
s.replace_pattern %r(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d [-+]\d{4}), '<#DATE#>' s.replace_pattern %r(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d [-+]\d{4}), '<#DATE#>'
s.replace_pattern %r(\(Took \d+.\d+ seconds\)), '(Took <#DURATION#> seconds)' s.replace_pattern %r(\(Took \d+.\d+ seconds\)), '(Took <#DURATION#> seconds)'
...@@ -135,9 +137,14 @@ describe_cli 'pod' do ...@@ -135,9 +137,14 @@ describe_cli 'pod' do
'install --no-repo-update' 'install --no-repo-update'
end end
describe 'Installs a Pod with different subspecs activated across different targets' do description = 'Installs a Pod with different subspecs activated across different targets'
behaves_like cli_spec 'install_subspecs', if has_mercurial
'install --no-repo-update' describe description do
behaves_like cli_spec 'install_subspecs',
'install --no-repo-update'
end
else
Bacon::ErrorLog << "[!] Skipping test due to missing `hg` executable: #{description}".red << "\n\n"
end end
describe 'Installs a Pod with subspecs and does not duplicate the prefix header' do describe 'Installs a Pod with subspecs and does not duplicate the prefix header' do
...@@ -150,9 +157,14 @@ describe_cli 'pod' do ...@@ -150,9 +157,14 @@ describe_cli 'pod' do
'install --no-repo-update' 'install --no-repo-update'
end end
describe 'Installs a Pod with an external source' do description = 'Installs a Pod with an external source'
behaves_like cli_spec 'install_external_source', if has_mercurial
'install --no-repo-update' describe description do
behaves_like cli_spec 'install_external_source',
'install --no-repo-update'
end
else
Bacon::ErrorLog << "[!] Skipping test due to missing `hg` executable: #{description}".red << "\n\n"
end end
describe 'Installs a Pod given the podspec' do describe 'Installs a Pod given the podspec' 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