spec/spec_helper.rb in ballast-2.2.3 vs spec/spec_helper.rb in ballast-2.2.4
- old
+ new
@@ -2,6 +2,23 @@
# This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#
require "bundler/setup"
-require File.dirname(__FILE__) + "/../lib/ballast"
\ No newline at end of file
+
+if ENV["COVERAGE"]
+ require "simplecov"
+ require "coveralls"
+
+ Coveralls.wear! if ENV["CI"]
+
+ SimpleCov.start do
+ root = Pathname.new(File.dirname(__FILE__)) + ".."
+
+ add_filter do |src_file|
+ path = Pathname.new(src_file.filename).relative_path_from(root).to_s
+ path !~ /^lib/
+ end
+ end
+end
+
+require File.dirname(__FILE__) + "/../lib/ballast"