Skip to content

Commit

Permalink
Using new rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos committed May 31, 2011
1 parent eb3ddf3 commit c66e864
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
38 changes: 17 additions & 21 deletions Rakefile
@@ -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"
Expand All @@ -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")
5 changes: 2 additions & 3 deletions couchrest.gemspec
Expand Up @@ -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
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
@@ -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.
Expand All @@ -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
Expand Down

0 comments on commit c66e864

Please sign in to comment.