Skip to content
Browse files

Swap test-unit for rspec and rcov

  • Loading branch information...
1 parent 6632ec1 commit bbde8ea75a570942344615a4db735a1ee6ab04cb @sferik committed
Showing with 47 additions and 18 deletions.
  1. +5 −6 .gitignore
  2. +3 −0 .rspec
  3. +14 −2 Gemfile.lock
  4. +23 −9 Rakefile
  5. +2 −1 twitter.gemspec
View
11 .gitignore
@@ -1,10 +1,9 @@
*.gem
.DS_Store
.bundle
-doc
-log
-pkg/*
-rdoc
.yardoc
-/doc
-/snippets
+coverage/*
+doc/*
+log/*
+pkg/*
+rdoc/*
View
3 .rspec
@@ -0,0 +1,3 @@
+--color
+--format=nested
+--backtrace
View
16 Gemfile.lock
@@ -16,6 +16,7 @@ GEM
ZenTest (4.4.0)
addressable (2.2.2)
bluecloth (2.0.9)
+ diff-lcs (1.1.2)
fakeweb (1.3.0)
faraday (0.5.1)
addressable (~> 2.2.2)
@@ -32,9 +33,19 @@ GEM
multipart-post (1.0.1)
rack (1.2.1)
rake (0.8.7)
+ rcov (0.9.9)
+ rspec (2.0.1)
+ rspec-core (~> 2.0.1)
+ rspec-expectations (~> 2.0.1)
+ rspec-mocks (~> 2.0.1)
+ rspec-core (2.0.1)
+ rspec-expectations (2.0.1)
+ diff-lcs (>= 1.1.2)
+ rspec-mocks (2.0.1)
+ rspec-core (~> 2.0.1)
+ rspec-expectations (~> 2.0.1)
shoulda (2.11.3)
simple_oauth (0.1.1)
- test-unit (2.1.1)
yard (0.6.1)
PLATFORMS
@@ -53,8 +64,9 @@ DEPENDENCIES
multi_json (~> 0.0.4)
multi_xml (~> 0.2.0)
rake (~> 0.8)
+ rcov (~> 0.9)
+ rspec (~> 2.0)
shoulda (~> 2.11)
simple_oauth (~> 0.1.1)
- test-unit (~> 2.1)
twitter!
yard (~> 0.6)
View
32 Rakefile
@@ -1,17 +1,31 @@
-require 'rake'
-require 'rake/testtask'
require 'bundler'
-
+Bundler.setup
Bundler::GemHelper.install_tasks
-Rake::TestTask.new(:test) do |test|
- test.libs << "test"
- test.ruby_opts << "-rubygems"
- test.pattern = "test/**/*_test.rb"
- test.verbose = true
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
+
+namespace :spec do
+ desc "Run all examples using rcov"
+ RSpec::Core::RakeTask.new(:rcov => :cleanup_rcov_files) do |task|
+ task.rcov = true
+ task.rcov_opts = %[--text-report --sort coverage]
+ end
+end
+
+task :cleanup_rcov_files do
+ rm_rf 'coverage'
end
-task :default => :test
+task :default => ["spec:rcov"]
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "twitter #{Twitter::VERSION}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
desc "Upload website files to rubyforge"
task :website do
View
3 twitter.gemspec
@@ -7,8 +7,9 @@ Gem::Specification.new do |s|
s.add_development_dependency("json_pure", "~> 1.4")
s.add_development_dependency("mocha", "~> 0.9")
s.add_development_dependency("rake", "~> 0.8")
+ s.add_development_dependency("rcov", "~> 0.9")
+ s.add_development_dependency("rspec", "~> 2.0")
s.add_development_dependency("shoulda", "~> 2.11")
- s.add_development_dependency("test-unit", "~> 2.1")
s.add_development_dependency("yard", "~> 0.6")
s.add_development_dependency("ZenTest", "~> 4.4")
s.add_runtime_dependency("addressable", "~> 2.2.2")

0 comments on commit bbde8ea

Please sign in to comment.
Something went wrong with that request. Please try again.