Permalink
Browse files

Invoke SimpleCov with 'rake spec:coverage'

  • Loading branch information...
1 parent 68fed35 commit 7749ecd7f9cd985c03f02adadae8ebe8a98681a3 @mshibuya committed Feb 24, 2012
Showing with 13 additions and 12 deletions.
  1. +6 −1 Rakefile
  2. +0 −4 lib/rails_admin/adapters/active_record.rb
  3. +0 −7 lib/rails_admin/adapters/mongoid.rb
  4. +1 −0 rails_admin.gemspec
  5. +6 −0 spec/spec_helper.rb
View
@@ -11,4 +11,9 @@ RSpec::Core::RakeTask.new(:spec)
task :test => :spec
task :default => :spec
-
+namespace :spec do
+ task :coverage do
+ ENV['INVOKE_SIMPLECOV'] = 'true'
+ Rake::Task[:spec].invoke
+ end
+end
@@ -81,10 +81,6 @@ def properties
end
end
- def model_store_exists?
- model.table_exists?
- end
-
def table_name
model.table_name
end
@@ -111,13 +111,6 @@ def properties
end
end
- def model_store_exists?
- # Collections are created on demand, so they always 'exist'.
- # If need to know if pre-exist we can do something like
- # model.db.collection_names.include?(model.collection.name)
- true
- end
-
def table_name
model.name.tableize
end
View
@@ -24,6 +24,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'mini_magick'
gem.add_development_dependency 'paperclip'
gem.add_development_dependency 'rspec-rails'
+ gem.add_development_dependency 'simplecov'
gem.authors = ["Erik Michaels-Ober", "Bogdan Gaza", "Petteri Kaapa", "Benoit Benezech"]
gem.description = %q{RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.}
gem.email = ['sferik@gmail.com', 'bogdan@cadmio.org', 'petteri.kaapa@gmail.com']
View
@@ -1,6 +1,12 @@
# Configure Rails Envinronment
ENV["RAILS_ENV"] = "test"
ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'true'
+
+if ENV['INVOKE_SIMPLECOV']
+ require 'simplecov'
+ SimpleCov.start 'rails'
+end
+
require File.expand_path('../dummy_app/config/environment', __FILE__)
require 'rspec/rails'

0 comments on commit 7749ecd

Please sign in to comment.