Commit 9d8276ed authored by Marius Rackwitz's avatar Marius Rackwitz

Allow to specify which functional spec should be run by rake argument

e.g. rake 'spec:functional[command/project]'
The single quotes are needed for zsh.
parent 5e1ae41f
...@@ -77,7 +77,7 @@ end ...@@ -77,7 +77,7 @@ end
namespace :spec do namespace :spec do
def specs(dir) def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ') FileList["spec/#{dir}_spec.rb"].shuffle.join(' ')
end end
#--------------------------------------# #--------------------------------------#
...@@ -89,7 +89,7 @@ namespace :spec do ...@@ -89,7 +89,7 @@ namespace :spec do
#--------------------------------------# #--------------------------------------#
unit_specs_command = "bundle exec bacon #{specs('unit/**')}" unit_specs_command = "bundle exec bacon #{specs('unit/**/*')}"
desc "Run the unit specs" desc "Run the unit specs"
task :unit => :unpack_fixture_tarballs do task :unit => :unpack_fixture_tarballs do
...@@ -104,8 +104,9 @@ namespace :spec do ...@@ -104,8 +104,9 @@ namespace :spec do
#--------------------------------------# #--------------------------------------#
desc "Run the functional specs" desc "Run the functional specs"
task :functional => :unpack_fixture_tarballs do task :functional, [:spec] => :unpack_fixture_tarballs do |t, args|
sh "bundle exec bacon #{specs('functional/**')}" args.with_defaults(:spec => '**/*')
sh "bundle exec bacon #{specs("functional/#{args[:spec]}")}"
end end
#--------------------------------------# #--------------------------------------#
...@@ -130,7 +131,7 @@ namespace :spec do ...@@ -130,7 +131,7 @@ namespace :spec do
ENV['GENERATE_COVERAGE'] = 'true' ENV['GENERATE_COVERAGE'] = 'true'
title 'Running the specs' title 'Running the specs'
sh "bundle exec bacon #{specs('**')}" sh "bundle exec bacon #{specs('**/*')}"
title 'Running Integration tests' title 'Running Integration tests'
sh "bundle exec bacon spec/integration.rb" sh "bundle exec bacon spec/integration.rb"
...@@ -144,7 +145,7 @@ namespace :spec do ...@@ -144,7 +145,7 @@ namespace :spec do
desc "Run all specs and build all examples" desc "Run all specs and build all examples"
task :ci => :unpack_fixture_tarballs do task :ci => :unpack_fixture_tarballs do
title 'Running the specs' title 'Running the specs'
sh "bundle exec bacon #{specs('**')}" sh "bundle exec bacon #{specs('**/*')}"
require 'pathname' require 'pathname'
unless Pathname.new(ENV['HOME']+'/.cocoapods/repos/master').exist? unless Pathname.new(ENV['HOME']+'/.cocoapods/repos/master').exist?
......
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