Rakefile in earth-0.4.4 vs Rakefile in earth-0.4.5
- old
+ new
@@ -3,25 +3,53 @@
Bundler::GemHelper.install_tasks
require 'bueller'
Bueller::Tasks.new
-begin
- require 'rake/rdoctask'
- Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'emitter'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+task :console do
+ Earth.init :all
+
+ require 'irb'
+ ARGV.clear
+ IRB.start
+end
+
+desc 'Run all cucumber tests'
+Cucumber::Rake::Task.new(:features) do |t|
+ if ENV['CUCUMBER_FORMAT']
+ t.cucumber_opts = "features --format #{ENV['CUCUMBER_FORMAT']}"
+ else
+ t.cucumber_opts = 'features --format pretty'
end
-rescue LoadError
- puts "Rdoc is not available"
end
-require 'sniff'
-require 'sniff/rake_tasks'
-Sniff::RakeTasks.define_tasks do |t|
- t.earth_domains = :all
- t.cucumber = true
- t.rspec = true
+desc "Run cucumber tests with RCov"
+Cucumber::Rake::Task.new(:features_with_coverage) do |t|
+ t.cucumber_opts = "features --format pretty"
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'features']
+end
+
+require 'rspec/core/rake_task'
+
+desc "Run all examples"
+RSpec::Core::RakeTask.new(:examples) do |c|
+ c.rspec_opts = '-Ispec'
+end
+
+desc "Run specs with RCov"
+RSpec::Core::RakeTask.new(:examples_with_coverage) do |t|
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec']
+ t.rspec_opts = '-Ispec'
+end
+
+task :test => [:features, :examples]
+task :default => :test
+
+require 'earth/version'
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "#{gemname} #{Earth::VERSION}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end