From 512c949e3c6d819f50b46ba379261b08c48931ab Mon Sep 17 00:00:00 2001 From: Antonio C Nalesso Moreira Date: Thu, 11 Jul 2013 04:00:06 +0100 Subject: [PATCH] added rake tasks, setup minitest --- Rakefile | 15 +++++++++++++-- tests/spec/rails_toggle_spec.rb | 4 ++++ tests/spec/test_helper.rb | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tests/spec/rails_toggle_spec.rb create mode 100644 tests/spec/test_helper.rb diff --git a/Rakefile b/Rakefile index 37960c8..bc38e61 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require 'bundler/setup' require 'rspec/core/rake_task' +require 'rake/testtask' Bundler::GemHelper.install_tasks @@ -9,8 +10,8 @@ RSpec::Core::RakeTask.new do |task| task.pattern = "./tests/test_app/spec/**/*_spec.rb" end -task :test => :spec -task :default => :spec +task :test_app => :spec +task :default => [:test, :test_app] namespace :impressionist do require File.dirname(__FILE__) + "/lib/impressionist/bots" @@ -19,4 +20,14 @@ namespace :impressionist do task :bots do p Impressionist::Bots.consume end + +end + +# setup :test task to minitest +# Rake libs default is lib +# libs << path to load test_helper, etc.. +Rake::TestTask.new do |t| + t.libs << 'tests/spec' + t.pattern = FileList['tests/spec/*_spec.rb'] + t.verbose = true end diff --git a/tests/spec/rails_toggle_spec.rb b/tests/spec/rails_toggle_spec.rb new file mode 100644 index 0000000..9f880dd --- /dev/null +++ b/tests/spec/rails_toggle_spec.rb @@ -0,0 +1,4 @@ +# Responsability + # Test whether rails version > 4 + # includes attr_accessible if < 4 +require "test_helper.rb" diff --git a/tests/spec/test_helper.rb b/tests/spec/test_helper.rb new file mode 100644 index 0000000..76af35e --- /dev/null +++ b/tests/spec/test_helper.rb @@ -0,0 +1,3 @@ +$:.unshift(File.dirname __FILE__) + +require "minitest/autorun"