Skip to content

Commit

Permalink
scrutinizer code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbeales committed Mar 28, 2018
1 parent e323d88 commit 627e53e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ build:

# Various pre-installed services that can be configured.
postgresql: true

tests:
override:
-
command: 'bundle exec rspec spec'
environment:
'SCRUTINIZER_CC_FILE': 'my-coverage'
coverage:
file: 'my-coverage'
format: 'rb-cc'
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ group :test do
gem 'rspec', '>= 3.7.0', require: false # for behavioral driven testing
gem 'rubocop', '>= 0.54.0', require: false # syntax checking
gem 'ruby_audit', '>= 1.2.0', require: false # complements bundler-audit
gem 'scrutinizer-ocular', '>= 1.0.1', require: false # scrutinizer code coverage
gem 'simplecov', '>= 0.16.1', require: false # for code coverage
gem 'simplecov-console', '>= 0.4.2', require: false # code coverage to console
gem 'timecop', '>= 0.9.1', require: false # testing time dependent
gem 'travis', '>= 1.8.8', require: false # for continuous integrations
gem 'travis_check_rubies', '>= 0.2.5', require: false # check ruby versions on Travis
Expand Down
11 changes: 10 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ GEM
activesupport (>= 4)
addressable (2.4.0)
alexa_verifier (1.0.0)
ansi (1.5.0)
arel (8.0.0)
ast (2.4.0)
backports (3.11.1)
Expand Down Expand Up @@ -82,6 +83,7 @@ GEM
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
highline (1.7.10)
hirb (0.7.3)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.9.5)
Expand Down Expand Up @@ -191,13 +193,19 @@ GEM
ruby_audit (1.2.0)
bundler-audit (~> 0.6.0)
ruby_dep (1.5.0)
scrutinizer-ocular (1.0.1)
simplecov (>= 0.7)
sdoc (1.0.0)
rdoc (>= 5.0)
shellany (0.0.1)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-console (0.4.2)
ansi
hirb
simplecov
simplecov-html (0.10.2)
sinatra (2.0.1)
mustermann (~> 1.0)
Expand Down Expand Up @@ -245,7 +253,6 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unf_ext (0.0.7.5-x64-mingw32)
unicode-display_width (1.3.0)
validates_email_format_of (1.6.3)
i18n
Expand Down Expand Up @@ -291,8 +298,10 @@ DEPENDENCIES
rspec (>= 3.7.0)
rubocop (>= 0.54.0)
ruby_audit (>= 1.2.0)
scrutinizer-ocular (>= 1.0.1)
sdoc (>= 1.0.0)
simplecov (>= 0.16.1)
simplecov-console (>= 0.4.2)
sinatra (>= 2.0.1)
sinatra-activerecord (>= 2.0.13)
sinatra-contrib (>= 2.0.1)
Expand Down
8 changes: 4 additions & 4 deletions spec/rspec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ JournalEntry
unique entry date
 {:timecop=>:freeze}
#to_s
 should eq "2018-03-28 03:47:53 UTC "
 should eq "2018-03-28 04:29:06 UTC "

Journal
 is an instance of Journal
Expand All @@ -400,7 +400,7 @@ Journal
 should not be truthy
#list_entries
defaults to last 4
 should eq "2018-03-28 03:47:53 UTC 2012-12-12 00:00:00 UTC "
 should eq "2018-03-28 04:29:06 UTC 2012-12-12 00:00:00 UTC "
#read_entry
 should be > 0
#name
Expand Down Expand Up @@ -972,7 +972,7 @@ AlexaService
 should eq " Cannot find instrument blah. Please try again.\n"
 should eq "Below is a list of the ways you might have felt or behaved. Please check the boxes to tell me how often you have felt this way in the past week or so."
#read_all
 should eq "2018-03-28 03:47:51 UTC "
 should eq "2018-03-28 04:29:05 UTC "
 should not be nil

InstrumentLoaderCsv
Expand Down Expand Up @@ -1000,6 +1000,6 @@ InstrumentLoader
missing instrument
 should raise RuntimeError

Finished in 10.68 seconds (files took 4.31 seconds to load)
Finished in 7.81 seconds (files took 4.3 seconds to load)
510 examples, 0 failures

15 changes: 14 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Coveralls.wear!

require 'simplecov'
require 'simplecov-console'

SimpleCov.profiles.define 'app' do
add_group 'Models', 'app/models'
Expand All @@ -43,7 +44,19 @@
add_filter 'app/secrets'
end

SimpleCov.formatter = Coveralls::SimpleCov::Formatter
require 'scrutinizer/ocular'
require 'scrutinizer/ocular/formatter'

Scrutinizer::Ocular.watch! 'app'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::Console,
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter,
Scrutinizer::Ocular::UploadingFormatter
]
)

SimpleCov.start 'app' do
track_files 'app.rb'
Expand Down

0 comments on commit 627e53e

Please sign in to comment.