Created
August 30, 2012 15:55
-
-
Save kenoir/3531585 to your computer and use it in GitHub Desktop.
Starter rakefile for PHP projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'configatron' | |
require 'colorize' | |
configatron.app_root= File.dirname(__FILE__) | |
configatron.app_name = "events" | |
configatron.relish_id = "bbc-knowlearn/kandl-events-poc" | |
def run_phpunit | |
system "phing -Dwebapp.name=#{configatron.app_name} -Dwebapp.root=#{configatron.app_root}/webapp test coverage -f #{configatron.app_root}/webapp/php/lib-test/all_tests.xml" | |
end | |
def push_relish | |
system "relish push #{configatron.relish_id}" | |
end | |
desc 'Push features to relish' | |
task :relish do | |
if !push_relish | |
abort "Couldn't push feature to relish!".red | |
end | |
end | |
desc 'Run PHPUnit Tests' | |
task :phpunit do | |
if !run_phpunit | |
abort "Failed to execute PHPUnit tests!".red | |
end | |
end | |
begin | |
require 'cucumber' | |
require 'cucumber/rake/task' | |
Cucumber::Rake::Task.new(:features, "Run Cukes") do |t| | |
end | |
rescue LoadError | |
desc 'Cucumber rake task not available' | |
task :features do | |
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' | |
end | |
end | |
task :default => [:features,:phpunit] do | |
puts "Test ".red + | |
"all ".blue + | |
"the ".yellow + | |
"things!".green | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment