Skip to content

Instantly share code, notes, and snippets.

@akamike
Created July 8, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akamike/393bede2b89645b946c8d95ac4f5bcf9 to your computer and use it in GitHub Desktop.
Save akamike/393bede2b89645b946c8d95ac4f5bcf9 to your computer and use it in GitHub Desktop.
Simplecov greedy filepath replace example
class Application
def did_not_touch
puts 'Poor coverage'
end
end
# Runs a ruby container, mounting current directory at /app,
# installs simplecov then runs the test file to generate a report
#
# Resulting coverage report will show "application.rb" cut to "lication.rb"
docker run --rm -v "$PWD:/app" -w /app -it ruby \
bash -c "gem install simplecov && ruby test.rb"
require 'simplecov'
SimpleCov.start
require './application'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment