Skip to content

Commit

Permalink
Add simplecov, tweak the seed task
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Jan 8, 2012
1 parent 04837f0 commit c05807f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -27,6 +27,7 @@ group :test do
gem 'vcr'
gem 'factory_girl_rails'
gem 'faker'
gem 'simplecov', :platform => 'mri_19'
end

gem "slugged", :git => "git://github.com/Sutto/slugged.git"
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -149,6 +149,10 @@ GEM
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
Expand Down Expand Up @@ -193,6 +197,7 @@ DEPENDENCIES
rspec
rspec-rails
sass-rails (~> 3.1.4)
simplecov
slugged!
thin
uglifier (>= 1.0.3)
Expand Down
2 changes: 1 addition & 1 deletion app/models/train_station.rb
Expand Up @@ -9,7 +9,7 @@ class TrainStation < ActiveRecord::Base
def self.seed!
destroy_all
TransperthClient.train_stations.each do |name|
create :name => name.gsub(/ Stn$/, '')
find_or_create_by_name name.gsub(/ Stn$/, '')
end
end

Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
@@ -1,4 +1,14 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'

begin
require 'simplecov'
SimpleCov.start 'rails' do
add_filter "/rocket_pants/"
end
rescue LoadError => e
puts 'SimpleCov not available, skipping coverage...'
end

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Expand Down

0 comments on commit c05807f

Please sign in to comment.