Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Migrate to RSpec-2.

  • Loading branch information...
commit 2eb7112cff5aa1c59408a186647c24428828ce83 1 parent e7838cb
@gix gix authored
Showing with 26 additions and 43 deletions.
  1. +1 −0  .rspec
  2. +25 −36 Rakefile
  3. +0 −7 spec/spec.opts
View
1  .rspec
@@ -0,0 +1 @@
+--colour
View
61 Rakefile
@@ -1,14 +1,4 @@
require 'rake'
-# require 'spec/rake/spectask'
-#
-# desc 'Default: run specs.'
-# task :default => :spec
-#
-# desc 'Run the specs'
-# Spec::Rake::SpecTask.new(:spec) do |t|
-# t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
-# t.spec_files = FileList['spec/**/*_spec.rb']
-# end
begin
require 'jeweler'
@@ -23,34 +13,33 @@ begin
gemspec.authors = ["Michael Bleigh"]
end
Jeweler::GemcutterTasks.new
+ FileList['tasks/**/*.rake'].each { |task| import task }
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
+begin
+ require 'rspec/core/rake_task'
+
+ task :cleanup_rcov_files do
+ rm_rf 'coverage.data'
+ end
+
+ desc "Run all specs."
+ RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_opts = %w[--color]
+ end
-# These are new tasks
-# begin
-# require 'rake/contrib/sshpublisher'
-# namespace :rubyforge do
-#
-# desc "Release gem and RDoc documentation to RubyForge"
-# task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
-#
-# namespace :release do
-# desc "Publish RDoc to RubyForge."
-# task :docs => [:rdoc] do
-# config = YAML.load(
-# File.read(File.expand_path('~/.rubyforge/user-config.yml'))
-# )
-#
-# host = "#{config['username']}@rubyforge.org"
-# remote_dir = "/var/www/gforge-projects/the-perfect-gem/"
-# local_dir = 'rdoc'
-#
-# Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
-# end
-# end
-# end
-# rescue LoadError
-# puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
-# end
+ namespace :spec do
+ desc "Run all specs using rcov."
+ RSpec::Core::RakeTask.new(:rcov => :cleanup_rcov_files) do |t|
+ t.rcov = true
+ t.rcov_opts = '-Ilib:spec --exclude "gems/.*,features"'
+ t.rcov_opts << %[--text-report --sort coverage --html --aggregate coverage.data]
+ end
+ end
+
+ task :default => :spec
+rescue LoadError
+ puts "RSpec-2 not available."
+end
View
7 spec/spec.opts
@@ -1,7 +0,0 @@
---colour
---format
-specdoc
---loadby
-mtime
---reverse
---backtrace
Please sign in to comment.
Something went wrong with that request. Please try again.