• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jjh42 / mock / 152 / 1
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 16 Aug 2017 09:08PM UTC
Files 1
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Aug 2017 09:06PM UTC coverage: 100.0%. Remained the same
MIX_ENV=test

push

travis-ci

web-flow
Implement setup_with_mocks (#68)

A helper macro that'll help avoid copy-pasting the same mock
if it is required for all unit tests in some ExUnit.Case.

For simplicity, only add support for mocking multiple modules
in setup without all the shorthand helpers when only one mock
is needed.

Wrapper macro for `setup_all` was not implemented because maintaining
the mock state across tests is difficult if one of the tests in
the module needs custom behaviour. For example, assume 9/10 tests
in some file need the same mock, but the one other test, which belongs
in the same file, does not. The one specific test can override the
'global' mock. This is easy to achieve using `setup` but more difficult
using `setup_all` and provides more developer friendly behaviour.

- Implement setup_with_mocks with support for when context is
  specified and when it is not
- Unit tests
- Move the logic of mocking multiple modules into a helper macro
- Update the README with an explanation and an example

2 of 2 relevant lines covered (100.0%)

18.0 hits per line

Source Files on job 152.1 (MIX_ENV=test)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 152
  • Travis Job 152.1
  • 04e27bbf on github
  • Prev Job for MIX_ENV=test on master (#146.1)
  • Next Job for MIX_ENV=test on master (#153.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc