Skip to content

Commit

Permalink
Add rcov task
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Sofaer committed Mar 2, 2011
1 parent 0cb218b commit 68f0f7e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public/stylesheets/*.css
public/diaspora
spec/fixtures/*.y*ml
spec/fixtures/*.fixture.*
coverage/*

# Uploded files and local files
public/uploads/*
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ group :test do
gem 'cucumber-rails', '0.3.2'
gem 'rspec', '>= 2.0.0'
gem 'rspec-rails', '>= 2.0.0'
gem 'rcov'
gem 'database_cleaner', '0.6.0'
gem 'webmock', :require => false
gem 'jasmine', :path => 'vendor/gems/jasmine', :require => false
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
rcov (0.9.9)
redis (2.1.1)
redis-namespace (0.8.0)
redis (< 3.0.0)
Expand Down Expand Up @@ -421,6 +422,7 @@ DEPENDENCIES
nokogiri (= 1.4.3.1)
omniauth (= 0.1.6)
rails (= 3.0.3)
rcov
resque (= 1.10.0)
rest-client (= 1.6.1)
roxml!
Expand Down
6 changes: 6 additions & 0 deletions lib/tasks/rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ task :stats => "spec:statsetup"
desc "Run all specs in spec directory (excluding plugin specs)"
RSpec::Core::RakeTask.new(:spec => spec_prereq)

desc "Run the specs with rcov"
Rspec::Core::RakeTask.new(:rcov => spec_prereq) do |t|
t.rcov = true
t.rcov_opts = ['-Ispec', '--exclude', 'spec', '--exclude', 'gems']
end
namespace :"spec --color" do
[:requests, :models, :controllers, :views, :helpers, :mailers, :lib].each do |sub|
desc "Run the code examples in spec/#{sub}"
Expand Down Expand Up @@ -66,5 +71,6 @@ namespace :"spec --color" do
::CodeStatistics::TEST_TYPES << "Routing specs" if File.exist?('spec/routing')
::CodeStatistics::TEST_TYPES << "Request specs" if File.exist?('spec/requests')
end

end

5 changes: 3 additions & 2 deletions spec/config/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

require 'spec_helper'
describe 'making sure the config is parsed as should' do

describe 'pod_url' do
it 'should have a trailing slash' do
AppConfig[:pod_url].should == 'http://example.org/'
end
end

describe 'terse_pod_url'
it 'should be correctly parsed' do
AppConfig[:pod_uri].host.should == 'example.org'
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require File.join(File.dirname(__FILE__), '..', 'config', 'environment') unless defined?(Rails)
require 'helper_methods'
require 'rspec/rails'
puts require 'rspec'
require 'webmock/rspec'
require 'factory_girl'

Expand Down

0 comments on commit 68f0f7e

Please sign in to comment.