lib/generators/extension/templates/RSpecRakefile in radiant-0.8.0 vs lib/generators/extension/templates/RSpecRakefile in radiant-0.8.1

- old
+ new

@@ -22,11 +22,12 @@ require 'rake/testtask' rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib') $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) require 'spec/rake/spectask' -# require 'spec/translator' +require 'cucumber' +require 'cucumber/rake/task' # Cleanup the RADIANT_ROOT constant so specs will load the environment Object.send(:remove_const, :RADIANT_ROOT) extension_root = File.expand_path(File.dirname(__FILE__)) @@ -38,10 +39,12 @@ Spec::Rake::SpecTask.new(:spec) do |t| t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] t.spec_files = FileList['spec/**/*_spec.rb'] end +task :features => 'spec:integration' + namespace :spec do desc "Run all specs in spec directory with RCov" Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] t.spec_files = FileList['spec/**/*_spec.rb'] @@ -61,16 +64,16 @@ t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"] end end - # Hopefully no one has written their extensions in pre-0.9 style - # desc "Translate specs from pre-0.9 to 0.9 style" - # task :translate do - # translator = ::Spec::Translator.new - # dir = RAILS_ROOT + '/spec' - # translator.translate(dir, dir) - # end + desc "Run the Cucumber features" + Cucumber::Rake::Task.new(:integration) do |t| + t.fork = true + t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')] + # t.feature_pattern = "#{extension_root}/features/**/*.feature" + t.profile = "default" + end # Setup specs for stats task :statsetup do require 'code_statistics' ::STATS_DIRECTORIES << %w(Model\ specs spec/models) \ No newline at end of file