Rakefile in locomotivecms-search-0.2.5 vs Rakefile in locomotivecms-search-0.2.6

- old
+ new

@@ -1,6 +1,8 @@ #!/usr/bin/env rake +require 'rspec/core/rake_task' + begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end @@ -20,16 +22,16 @@ rdoc.rdoc_files.include('lib/**/*.rb') end Bundler::GemHelper.install_tasks -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = false +Dir["spec/features/*_spec.rb"].each do |spec_file| + name = File.basename(spec_file).gsub('_spec.rb', '') + desc "Run #{name} specs" + RSpec::Core::RakeTask.new("spec:#{name}") do |t| + t.pattern = spec_file + end end - -task :default => :test +desc "Run specs" +task spec: Rake.application.tasks.select { |t| t.name.start_with?("spec:") } +task :default => :spec \ No newline at end of file