Permalink
Browse files

rake tasks

  • Loading branch information...
1 parent e862d9b commit 912ebd86cd710c04fc82a35f5e5764a3036ae02e @pastorius committed Oct 13, 2011
Showing with 50 additions and 14 deletions.
  1. +0 −12 .autotest
  2. +10 −0 .gitignore
  3. +0 −2 .minitest.rb
  4. +37 −0 Rakefile
  5. +2 −0 prixfixe.gemspec
  6. +1 −0 test/test_helper.rb
View
@@ -1,12 +0,0 @@
-require 'autotest/restart'
-
-Autotest.add_hook :initialize do |at|
- at.testlib = ".minitest.rb"
- at.add_mapping(%r%^lib/prixfixe/(.*)\.rb$%) { |_, m|
- ["test/#{m[1]}_test.rb"]
- }
-end
-
-Autotest.add_hook :all_good do |at|
- system "rake rcov_info"
-end if ENV['RCOV']
View
@@ -1 +1,11 @@
+# bundler
+.bundle
+
+# rcov generated
+coverage
+
+# yard generated
+doc
+.yardoc
+
Gemfile.lock
View
@@ -1,2 +0,0 @@
-# gem "minitest"
-require "minitest/autorun"
View
@@ -1 +1,38 @@
+# encoding: utf-8
+
+require 'rubygems'
+require 'bundler'
require "bundler/gem_tasks"
+
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+
+$LOAD_PATH.unshift('lib')
+
+require 'rake'
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.test_files = FileList.new('test/**/*_test.rb') do |list|
+ list.exclude 'test/test_helper.rb'
+ end
+ test.libs << 'test'
+ test.verbose = true
+end
+
+require 'yard'
+YARD::Rake::YardocTask.new do |t|
+ t.files = FileList['lib/**/*.rb']
+end
+
+require 'rcov/rcovtask'
+Rcov::RcovTask.new(:rcov => :check_dependencies) do |rcov|
+ rcov.libs << 'test'
+ rcov.pattern = 'test/**/*_test.rb'
+end
+
+task :default => :test
View
@@ -20,6 +20,8 @@ Gem::Specification.new do |s|
# specify any dependencies here; for example:
s.add_development_dependency "rake"
+ s.add_development_dependency "yard"
+ s.add_development_dependency "rcov"
s.add_development_dependency "minitest"
# s.add_runtime_dependency "rest-client"
end
View
@@ -1,3 +1,4 @@
+require 'minitest/autorun'
require 'prixfixe'
require 'ostruct'

0 comments on commit 912ebd8

Please sign in to comment.