I am working on a small plugin and include simple words. In my gem file, I have a line:
gem 'simplecov', :require => false, :group => :test
In my test file, I put the line require "projectname/devuntil/rspec/spec_helper" at the very top of the file.
In my spec_helper.rb file, I add simplecov at the top of the file
if ENV['COVERAGE'] require 'simplecov' require 'coveralls' puts "require simplecov and coveralls" SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter ] SimpleCov.start do add_filter 'spec/' add_filter 'vendor/' puts "Start simple coverage" end end
When I try to run a test using the COVERAGE=true bundle exec rspec , it shows:
[ root@node1 logstash-input-imap]
Although my function was called, but it still showed 0.0%. What could be the problem here and how to fix it? Thanks
source share