Rakefile in expandsync-0.1.0 vs Rakefile in expandsync-0.1.1

- old
+ new

@@ -1,61 +1,39 @@ -def dump_load_path - puts $LOAD_PATH.join("\n") - found = nil - $LOAD_PATH.each do |path| - if File.exists?(File.join(path,"rspec")) - puts "Found rspec in #{path}" - if File.exists?(File.join(path,"rspec","core")) - puts "Found core" - if File.exists?(File.join(path,"rspec","core","rake_task")) - puts "Found rake_task" - found = path - else - puts "!! no rake_task" - end - else - puts "!!! no core" - end - end - end - if found.nil? - puts "Didn't find rspec/core/rake_task anywhere" - else - puts "Found in #{path}" - end -end -require 'bundler' require 'rake/clean' - -require 'rake/testtask' - +require 'rubygems' +require 'rubygems/package_task' require 'cucumber' require 'cucumber/rake/task' -gem 'rdoc' # we need the installed RDoc gem, not the system one -require 'rdoc/task' +spec = eval(File.read('expandsync.gemspec')) -include Rake::DSL - -Bundler::GemHelper.install_tasks - - -Rake::TestTask.new do |t| - t.pattern = 'test/tc_*.rb' +Gem::PackageTask.new(spec) do |pkg| end - CUKE_RESULTS = 'results.html' CLEAN << CUKE_RESULTS + +desc 'Run features' Cucumber::Rake::Task.new(:features) do |t| - t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x" + opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x" + opts += " --tags #{ENV['TAGS']}" if ENV['TAGS'] + t.cucumber_opts = opts t.fork = false end -Rake::RDocTask.new do |rd| - - rd.main = "README.rdoc" - - rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*") +desc 'Run features tagged as work-in-progress (@wip)' +Cucumber::Rake::Task.new('features:wip') do |t| + tag_opts = ' --tags ~@pending' + tag_opts = ' --tags @wip' + t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}" + t.fork = false end -task :default => [:test,:features] +task :cucumber => :features +task 'cucumber:wip' => 'features:wip' +task :wip => 'features:wip' +require 'rake/testtask' +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList['test/*_test.rb'] +end +task :default => [:test,:features]