kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
12 years ago
|
# Run all core and plugins specs via
|
||
|
# rake spec_all
|
||
|
#
|
||
|
# Run plugins specs via
|
||
|
# rake spec_plugins
|
||
|
#
|
||
12 years ago
|
# A plugin must register for tests via config variable 'plugins_to_test_paths'
|
||
|
#
|
||
|
# e.g.
|
||
|
# class Engine < ::Rails::Engine
|
||
|
# initializer 'register_path_to_rspec' do |app|
|
||
|
# app.config.plugins_to_test_paths << self.root
|
||
|
# end
|
||
|
# end
|
||
|
#
|
||
|
|
||
12 years ago
|
begin
|
||
|
require "rspec/core/rake_task"
|
||
12 years ago
|
|
||
12 years ago
|
namespace :spec do
|
||
|
desc "Run core and plugin specs"
|
||
|
RSpec::Core::RakeTask.new(:all => :environment) do |t|
|
||
|
pattern = []
|
||
|
dirs = get_plugins_to_test
|
||
|
dirs << File.join(Rails.root).to_s
|
||
|
dirs.each do |dir|
|
||
|
if File.directory?( dir )
|
||
|
pattern << File.join( dir, 'spec', '**', '*_spec.rb' ).to_s
|
||
|
end
|
||
12 years ago
|
end
|
||
12 years ago
|
t.fail_on_error = false
|
||
|
t.pattern = pattern
|
||
12 years ago
|
end
|
||
|
|
||
12 years ago
|
desc "Run plugin specs"
|
||
|
RSpec::Core::RakeTask.new(:plugins => :environment) do |t|
|
||
|
pattern = []
|
||
|
get_plugins_to_test.each do |dir|
|
||
|
if File.directory?( dir )
|
||
|
pattern << File.join( dir, 'spec', '**', '*_spec.rb' ).to_s
|
||
|
end
|
||
12 years ago
|
end
|
||
12 years ago
|
t.fail_on_error = false
|
||
|
t.pattern = pattern
|
||
12 years ago
|
end
|
||
|
end
|
||
12 years ago
|
rescue LoadError
|
||
12 years ago
|
end
|
||
|
|
||
|
def get_plugins_to_test
|
||
|
plugin_paths = []
|
||
|
Rails.application.config.plugins_to_test_paths.each do |dir|
|
||
|
if File.directory?( dir )
|
||
|
plugin_paths << File.join(dir).to_s
|
||
|
end
|
||
|
end
|
||
|
plugin_paths
|
||
|
end
|