summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluu stiles <luuduong@gmail.com>2012-10-16 00:02:40 -0600
committerluu stiles <luuduong@gmail.com>2012-10-16 00:02:40 -0600
commite7a1bb628ef077cb980c701d1d11ec84664ed939 (patch)
tree54d80b00dc23fd12d826f6ec5223aae21bdf1dd2
parentc2907d3c9c6ba14fd9b0e56285eb761a4bcf2955 (diff)
added simplecov to project for code coverage stats
-rw-r--r--.gitignore1
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock5
-rw-r--r--db/schema.rb36
-rw-r--r--script/rails8
-rw-r--r--spec/spec_helper.rb3
6 files changed, 36 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index 50c5c81d..97ea3121 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ tags
*.fuse*
latest
config/database.yml
+coverage
diff --git a/Gemfile b/Gemfile
index d2140b9c..e53e9c6e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -18,6 +18,7 @@ gem 'acts-as-taggable-on'
gem 'newrelic_rpm'
gem 'delayed_job_active_record'
gem 'daemons'
+gem 'simplecov', :require => false, :group => :test
group :development, :test do
gem 'pg'
diff --git a/Gemfile.lock b/Gemfile.lock
index 8f735bae..aaadf44a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -255,6 +255,10 @@ GEM
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
+ simplecov (0.7.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.7.1)
+ simplecov-html (0.7.1)
spork (0.9.2)
sprockets (2.1.3)
hike (~> 1.2)
@@ -318,6 +322,7 @@ DEPENDENCIES
rspec-rails
rvm-capistrano
sass-rails
+ simplecov
spork
sqlite3
uglifier
diff --git a/db/schema.rb b/db/schema.rb
index 4d9fe3db..062bce7f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -29,18 +29,18 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id"
create_table "admin_users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
+ t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
@@ -55,8 +55,8 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
create_table "categories", :force => true do |t|
t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "slug"
end
@@ -80,8 +80,8 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
create_table "creations", :force => true do |t|
t.string "name"
t.text "story"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "user_id"
t.string "image"
t.boolean "is_restricted", :default => false, :null => false
@@ -113,8 +113,8 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
create_table "favorites", :force => true do |t|
t.integer "user_id"
t.integer "creation_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "interests", :force => true do |t|
@@ -126,8 +126,8 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
create_table "photos", :force => true do |t|
t.integer "creation_id"
t.string "image"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "is_primary", :default => false
end
@@ -163,18 +163,18 @@ ActiveRecord::Schema.define(:version => 20121013031725) do
end
create_table "users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
+ t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "name"
t.string "website"
t.string "twitter"
diff --git a/script/rails b/script/rails
index f8da2cff..280205a2 100644
--- a/script/rails
+++ b/script/rails
@@ -1,6 +1,14 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+# see all code executed by the rails server, and not just code executed in your actual test files, https://github.com/colszowka/simplecov
+if ENV['RAILS_ENV'] == 'test'
+ require 'simplecov'
+ SimpleCov.start 'rails'
+ puts "required simplecov"
+end
+
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b25c1f83..def478f1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,6 @@
+require 'simplecov'
+SimpleCov.start 'rails'
+
require 'rubygems'
require 'spork'