Skip to content

Commit

Permalink
update Rakefile and fix specs so they all run under rake
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskite committed Apr 15, 2011
1 parent 264dffc commit 90d48c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
15 changes: 7 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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|
Expand All @@ -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
8 changes: 1 addition & 7 deletions spec/http_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$:.unshift(File.dirname(__FILE__))
require 'spec_helper'

module Anemone
Expand All @@ -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
Expand Down

0 comments on commit 90d48c4

Please sign in to comment.