Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Updated Rakefile to use rspec, SimpleCov and added pry task. And fixed annoying rake/rspec deprecation warning. #4

Open
wants to merge 1 commit into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2012
  1. @sent-hil
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 10 deletions.
  1. +19 −10 Rakefile
View
29 Rakefile
@@ -43,24 +43,23 @@ end
#
#############################################################################
-task :default => :test
+task :default => :spec
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
+require "rspec/core/rake_task"
+
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rspec_opts = ['--backtrace']
end
-desc "Generate RCov test coverage and open in your browser"
+desc "Generate SimpleCov test coverage and open in your browser"
task :coverage do
- require 'rcov'
sh "rm -fr coverage"
- sh "rcov test/test_*.rb"
+ sh "ruby -e \"require 'simplecov'\; SimpleCov.start\" "
sh "open coverage/index.html"
end
-require 'rake/rdoctask'
+require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
@@ -73,6 +72,16 @@ task :console do
sh "irb -rubygems -r ./lib/#{name}.rb"
end
+desc "Open an irb session preloaded with this library"
+task :irb do
+ sh "irb -rubygems -r ./lib/#{name}.rb"
+end
+
+desc "Open an pry session preloaded with this library"
+task :pry do
+ sh "pry -r ./lib/#{name}.rb"
+end
+
#############################################################################
#
# Custom tasks (add your own tasks here)
Something went wrong with that request. Please try again.