Skip to content

Commit

Permalink
travis tweaks and working local coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
shime committed Jul 27, 2013
1 parent b364257 commit 2ecc4af
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: ruby
env:
- TRAVIS=true
rvm:
- "1.9.3"
before_script:
- rake config:defaults
- rake config:travis
- rake db:test:prepare
- RAILS_ENV=test rake db:setup
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ group :development, :test do
end

group :test do
gem "simplecov"
gem "simplecov", require: false
gem "database_cleaner"
gem "email_spec"
end
6 changes: 1 addition & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ require 'rspec/core/rake_task'

Cipele46Web::Application.load_tasks

RSpec::Core::RakeTask.new(:spec)

task :default do
Rake::Task["spec"].invoke
end
task :default => [:spec, :spinach]
7 changes: 5 additions & 2 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require 'simplecov' unless ENV['CI']
ENV['RAILS_ENV'] ||= 'test'

if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
elsif ENV["RAILS_ENV"] == "test"
require 'simplecov'
SimpleCov.start 'rails'
SimpleCov.coverage_dir 'coverage/features'
end

ENV['RAILS_ENV'] ||= 'test'
require "./config/environment"

require "rspec/rails"
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace :config do
end
exit 0
end

desc "Copy travis config over database.yml"
task :travis do
cp Rails.root.join('config/database.yml.travis'), Rails.root.join('config/database.yml')
Expand Down
13 changes: 10 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
require 'coveralls'
Coveralls.wear!('rails')
ENV["RAILS_ENV"] ||= 'test'

if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
elsif ENV["RAILS_ENV"] == "test"
require 'simplecov'
SimpleCov.start 'rails'
SimpleCov.coverage_dir 'coverage/spec'
end

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] = 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'email_spec'
Expand Down

0 comments on commit 2ecc4af

Please sign in to comment.