require 'rubygems' require 'rake' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "pickle-dupe" gem.summary = %Q{Pickle that works with Dupe, an Active Resource mocking/factory} gem.description = %Q{Dupe is Active Resource mocking/factory for use with cucumber. Pickle-dupe is a pickle add-on that works with Dupe} gem.email = "gary.s.cheong@gmail.com" gem.homepage = "http://github.com/iawgens/pickle-dupe" gem.authors = ["iawgens"] gem.add_dependency "pickle",">=0.2.1" gem.add_dependency "dupe",">=0.4.8" # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings end Jeweler::GemcutterTasks.new rescue LoadError puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" end require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' test.pattern = 'test/**/test_*.rb' test.verbose = true end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |test| test.libs << 'spec' test.pattern = 'spec/**/*_spec.rb' test.verbose = true end rescue LoadError task :rcov do abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" end end task :test => :check_dependencies task :default => :test require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.rdoc_dir = 'rdoc' rdoc.title = "pickle-dupe #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end ## cucumber rake tasks unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks # vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first # $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? vendored_cucumber_bin = nil begin require 'cucumber/rake/task' namespace :cucumber do Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t| t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. t.fork = true # You may get faster startup if you set this to false t.profile = 'default' end Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| t.binary = vendored_cucumber_bin t.fork = true # You may get faster startup if you set this to false t.profile = 'wip' end desc 'Run all features' task :all => [:ok, :wip] end desc 'Alias for cucumber:ok' task :cucumber => 'cucumber:ok' task :default => :cucumber task :features => :cucumber do STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" end rescue LoadError desc 'cucumber rake task not available (cucumber not installed)' task :cucumber do abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' end end end