Permalink
Browse files

Using Rspec instead of Test::Unit

  • Loading branch information...
1 parent 3dddb31 commit 3391703321eefad68f2dd17d67eb5ad11c71dc79 @andersondias committed May 22, 2009
Showing with 33 additions and 20 deletions.
  1. +16 −9 Rakefile
  2. +6 −0 spec/migreme_helper_spec.rb
  3. +5 −0 spec/migreme_url_spec.rb
  4. +6 −0 spec/spec_helper.rb
  5. +0 −8 test/migreme_url_test.rb
  6. +0 −3 test/test_helper.rb
View
@@ -1,16 +1,22 @@
require 'rake'
-require 'rake/testtask'
+require 'spec/rake/spectask'
require 'rake/rdoctask'
-desc 'Default: run unit tests.'
-task :default => :test
+desc 'Default: run specs.'
+task :default => :spec
-desc 'Test the migreme_url plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
+spec_files = Rake::FileList["spec/**/*_spec.rb"]
+
+Spec::Rake::SpecTask.new do |t|
+ t.spec_files = spec_files
+ t.spec_opts = ["-c"]
+end
+
+desc "Generate code coverage"
+Spec::Rake::SpecTask.new(:coverage) do |t|
+ t.spec_files = spec_files
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec,/var/lib/gems']
end
desc 'Generate documentation for the migreme_url plugin.'
@@ -21,3 +27,4 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/spec_helper'
+
+describe MigreMeHelper do
+ it 'should return true' do
+ end
+end
View
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/spec_helper'
+describe MigreMeUrl do
+ it 'should return true' do
+ end
+end
View
@@ -0,0 +1,6 @@
+$: << File.dirname(__FILE__) + '/../lib'
+
+require 'rubygems'
+require 'spec'
+require 'migreme_url'
+require 'migreme_helper'
View
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class MigremeUrlTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
View
@@ -1,3 +0,0 @@
-require 'rubygems'
-require 'active_support'
-require 'active_support/test_case'

0 comments on commit 3391703

Please sign in to comment.