diff --git a/Gemfile b/Gemfile index 3751c4725..dcbb6be0e 100644 --- a/Gemfile +++ b/Gemfile @@ -61,6 +61,7 @@ end # For running unit tests group :test do + gem 'simplecov', '~> 0.22' gem 'test-unit-full', '~> 0.0.5' gem 'rspec', '~> 3.13' gem 'rdoc', '~> 7.1' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ee4416be9..b4a4e7df2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,16 @@ # Browser Exploitation Framework (BeEF) - https://beefproject.com # See the file 'doc/COPYING' for copying permission # +# Coverage must start before loading application code. +require 'simplecov' +SimpleCov.start do + add_filter '/spec/' + add_group 'Core', 'core' + add_group 'Extensions', 'extensions' + add_group 'Modules', 'modules' + track_files '{core,extensions,modules}/**/*.rb' +end + # Set external and internal character encodings to UTF-8 Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 @@ -377,4 +387,4 @@ module SpecActiveRecordConnection ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate end end -end \ No newline at end of file +end