Permalink
Browse files

Using new rspec

  • Loading branch information...
tapajos committed May 31, 2011
1 parent eb3ddf3 commit c66e864f705cb8636e3ccf905fec4a1de27a7b2d
Showing with 22 additions and 26 deletions.
  1. +17 −21 Rakefile
  2. +2 −3 couchrest.gemspec
  3. +3 −2 spec/spec_helper.rb
View
@@ -1,33 +1,20 @@
require 'rubygems'
require 'bundler'
-Bundler::GemHelper.install_tasks
-
-require 'rake'
+require 'rspec/core/rake_task'
require "rake/rdoctask"
-$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
-require 'couchrest'
-
-begin
- require 'spec/rake/spectask'
-rescue LoadError
- puts <<-EOS
-To use rspec for testing you must install rspec gem:
- gem install rspec
-EOS
- exit(0)
-end
+Bundler::GemHelper.install_tasks
desc "Run all specs"
-Spec::Rake::SpecTask.new('spec') do |t|
- t.spec_opts = ["--color"]
- t.spec_files = FileList['spec/**/*_spec.rb']
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.rspec_opts = ["--color"]
+ spec.pattern = 'spec/**/*_spec.rb'
end
desc "Print specdocs"
-Spec::Rake::SpecTask.new(:doc) do |t|
- t.spec_opts = ["--format", "specdoc"]
- t.spec_files = FileList['spec/*_spec.rb']
+RSpec::Core::RakeTask.new(:doc) do |spec|
+ spec.rspec_opts = ["--format", "specdoc"]
+ spec.pattern = 'spec/*_spec.rb'
end
desc "Generate the rdoc"
@@ -40,3 +27,12 @@ end
desc "Run the rspec"
task :default => :spec
+
+module Rake
+ def self.remove_task(task_name)
+ Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
+ end
+end
+
+Rake.remove_task("github:release")
+Rake.remove_task("release")
View
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
s.add_dependency(%q<rest-client>, ["~> 1.6.1"])
s.add_dependency(%q<mime-types>, ["~> 1.15"])
- s.add_dependency(%q<json>, ["~> 1.5.1"])
- s.add_development_dependency(%q<rspec>, "~> 1.3.0")
-
+ s.add_development_dependency(%q<json>, ["~> 1.5.1"])
+ s.add_development_dependency(%q<rspec>, "~> 2.6.0")
end
View
@@ -1,5 +1,6 @@
+require "bundler/setup"
require "rubygems"
-require "spec" # Satisfies Autotest and anyone else not using the Rake tasks
+require "rspec"
require File.join(File.dirname(__FILE__), '..','lib','couchrest')
# check the following file to see how to use the spec'd features.
@@ -21,7 +22,7 @@ def reset_test_db!
DB
end
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
config.before(:all) { reset_test_db! }
config.after(:all) do

0 comments on commit c66e864

Please sign in to comment.