Skip to content
Browse files

update Rakefile and fix specs so they all run under rake

  • Loading branch information...
1 parent 264dffc commit 90d48c4266ab0d63b4f6f978cdeded9ddf5b0b07 @chriskite committed Apr 15, 2011
Showing with 8 additions and 15 deletions.
  1. +7 −8 Rakefile
  2. +1 −7 spec/http_spec.rb
View
15 Rakefile
@@ -1,19 +1,18 @@
require 'rubygems'
require 'rake'
+require 'rspec/core/rake_task'
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
+desc "Run all specs"
+RSpec::Core::RakeTask.new(:rspec) do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
end
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
+RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
-task :default => :spec
+task :default => :rspec
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
@@ -23,4 +22,4 @@ Rake::RDocTask.new do |rdoc|
rdoc.title = "anemone #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
-end
+end
View
8 spec/http_spec.rb
@@ -1,4 +1,3 @@
-$:.unshift(File.dirname(__FILE__))
require 'spec_helper'
module Anemone
@@ -10,12 +9,7 @@ module Anemone
end
it "should still return a Page if an exception occurs during the HTTP connection" do
- class HTTP
- def refresh_connection
- raise "test exception"
- end
- end
-
+ HTTP.stub!(:refresh_connection).and_raise(StandardError)
http = Anemone::HTTP.new
http.fetch_page(SPEC_DOMAIN).should be_an_instance_of(Page)
end

0 comments on commit 90d48c4

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