mirror of
https://github.com/kemko/paperclip.git
synced 2026-01-01 16:05:40 +03:00
Add coverage
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ gemfiles/*.lock
|
||||
gemfiles/.bundle/
|
||||
tmp/
|
||||
.rubocop-*
|
||||
/coverage/
|
||||
|
||||
7
.pryrc
Normal file
7
.pryrc
Normal file
@@ -0,0 +1,7 @@
|
||||
# Alieases for debugger.
|
||||
if defined?(PryByebug) || defined?(PryDebugger)
|
||||
Pry.commands.alias_command 'c', 'continue'
|
||||
Pry.commands.alias_command 's', 'step'
|
||||
Pry.commands.alias_command 'n', 'next'
|
||||
Pry.commands.alias_command 'f', 'finish'
|
||||
end
|
||||
1
Gemfile
1
Gemfile
@@ -15,6 +15,7 @@ gem 'rails'
|
||||
gem 'sidekiq'
|
||||
|
||||
gem 'test-unit'
|
||||
gem 'simplecov', require: false
|
||||
gem 'mocha'
|
||||
gem 'thoughtbot-shoulda', '>= 2.9.0'
|
||||
|
||||
|
||||
10
Rakefile
10
Rakefile
@@ -3,7 +3,6 @@ require 'rake/testtask'
|
||||
require 'rdoc/task'
|
||||
|
||||
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
|
||||
require 'paperclip'
|
||||
|
||||
import 'lib/tasks/paperclip_tasks.rake'
|
||||
|
||||
@@ -19,7 +18,7 @@ Rake::TestTask.new(:test) do |t|
|
||||
end
|
||||
|
||||
desc 'Start an IRB session with all necessary files required.'
|
||||
task :shell do
|
||||
task :shell => :load_paperclip do
|
||||
chdir File.dirname(__FILE__)
|
||||
exec 'irb -I lib/ -I lib/paperclip -r rubygems -r active_record -r tempfile -r init'
|
||||
end
|
||||
@@ -62,7 +61,11 @@ exclude_file_globs = ["test/s3.yml",
|
||||
"test/pkg/*",
|
||||
"test/tmp",
|
||||
"test/tmp/*"]
|
||||
spec = Gem::Specification.new do |s|
|
||||
|
||||
def spec
|
||||
# TODO: require 'paperclip/version'
|
||||
require 'paperclip'
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "paperclip"
|
||||
s.version = Paperclip::VERSION
|
||||
s.author = "Jon Yurek"
|
||||
@@ -80,6 +83,7 @@ spec = Gem::Specification.new do |s|
|
||||
s.add_development_dependency 'thoughtbot-shoulda'
|
||||
s.add_development_dependency 'mocha'
|
||||
end
|
||||
end
|
||||
|
||||
desc "Print a list of the files to be put into the gem"
|
||||
task :manifest => :clean do
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'test/unit'
|
||||
require 'shoulda'
|
||||
require 'mocha/test_unit'
|
||||
@@ -13,6 +15,24 @@ require 'active_record'
|
||||
require 'active_support'
|
||||
require 'rails'
|
||||
|
||||
if ENV['COVERAGE']
|
||||
require 'simplecov'
|
||||
|
||||
SimpleCov.external_at_exit = true
|
||||
Test::Unit.at_exit do
|
||||
SimpleCov.at_exit_behavior
|
||||
end
|
||||
SimpleCov.command_name 'test:units'
|
||||
SimpleCov.start do
|
||||
load_profile "test_frameworks"
|
||||
|
||||
add_group "Storage", "lib/paperclip/storage/"
|
||||
add_group "Libraries", "lib/"
|
||||
|
||||
track_files "{lib}/**/*.rb"
|
||||
end
|
||||
end
|
||||
|
||||
ROOT = File.expand_path('../', __dir__)
|
||||
|
||||
ENV['RAILS_ENV'] = 'test'
|
||||
@@ -20,9 +40,10 @@ class TestRailsApp < Rails::Application; end
|
||||
Rails.application.config.root = "#{ROOT}/tmp/rails"
|
||||
|
||||
$LOAD_PATH << File.join(ROOT, 'lib')
|
||||
$LOAD_PATH << File.join(ROOT, 'lib', 'paperclip')
|
||||
$LOAD_PATH << File.join(ROOT, 'lib/paperclip') # ??
|
||||
|
||||
require File.join(ROOT, 'lib', 'paperclip.rb')
|
||||
require 'paperclip'
|
||||
# require File.join(ROOT, 'lib/paperclip.rb')
|
||||
|
||||
require 'shoulda_macros/paperclip'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user