Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 19 additions & 10 deletions Rakefile
Expand Up @@ -43,24 +43,23 @@ end
# #
############################################################################# #############################################################################


task :default => :test task :default => :spec


require 'rake/testtask' require "rspec/core/rake_task"
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test' RSpec::Core::RakeTask.new(:spec) do |spec|
test.pattern = 'test/**/test_*.rb' spec.pattern = 'spec/**/*_spec.rb'
test.verbose = true spec.rspec_opts = ['--backtrace']
end end


desc "Generate RCov test coverage and open in your browser" desc "Generate SimpleCov test coverage and open in your browser"
task :coverage do task :coverage do
require 'rcov'
sh "rm -fr coverage" sh "rm -fr coverage"
sh "rcov test/test_*.rb" sh "ruby -e \"require 'simplecov'\; SimpleCov.start\" "
sh "open coverage/index.html" sh "open coverage/index.html"
end end


require 'rake/rdoctask' require 'rdoc/task'
Rake::RDocTask.new do |rdoc| Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc' rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}" rdoc.title = "#{name} #{version}"
Expand All @@ -73,6 +72,16 @@ task :console do
sh "irb -rubygems -r ./lib/#{name}.rb" sh "irb -rubygems -r ./lib/#{name}.rb"
end 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) # Custom tasks (add your own tasks here)
Expand Down