Rakefile in spreewald-0.7.0 vs Rakefile in spreewald-0.8.0
- old
+ new
@@ -13,10 +13,36 @@
length_of_steps_section = (readme[(start_of_steps_section+1)..-1] =~ /^##[^#]/) || readme.size - start_of_steps_section
readme[start_of_steps_section, length_of_steps_section] = "## Steps\n\n" + DocumentationGenerator::StepDefinitionsDirectory.new('lib/spreewald').format
File.open('README.md', 'w') { |f| f.write(readme) }
end
+namespace :travis do
+
+ desc 'Run tests in Travis CI'
+ task :run => [:slimgems, :create_database, :create_database_yml] do
+ Rake::Task['tests:bundle'].invoke
+ Rake::Task['tests:run'].invoke
+ end
+
+ desc 'Install slimgems'
+ task :slimgems do
+ system('gem install slimgems')
+ end
+
+ desc 'Creates a test database'
+ task :create_database do
+ system("mysql -e 'create database spreewald_test;'")
+ end
+
+ desc 'Creates a database.yml'
+ task :create_database_yml do
+ config_dir = "tests/shared/config"
+ system("cp #{config_dir}/database.sample.yml #{config_dir}/database.yml")
+ end
+
+end
+
namespace :tests do
desc "Run tests on all test apps"
task :run do # to run the tests type "rake tests:run" into your console
success = true
@@ -47,8 +73,11 @@
def for_each_directory_of(path, &block)
Dir[path].sort.each do |rakefile|
directory = File.dirname(rakefile)
puts '', "\033[44m#{directory}\033[0m", ''
- block.call(directory)
+
+ unless RUBY_VERSION.start_with?("1.9") and directory.include?("rails-2.3")
+ block.call(directory)
+ end
end
end