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

mbland / go-script-bash / 690 / 1
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: multiple-script-dirs
DEFAULT BRANCH: master
Ran 01 Sep 2017 12:01AM UTC
Files 61
Run time 3min
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

31 Aug 2017 08:21PM UTC coverage: 94.619%. First build
690.1

push

travis-ci

mbland
bats/helpers: Reset executable hash after stubbing

`stub_program_in_path` now calls `hash` on the new stub to ensure it is
discovered instead of the implementation it's intended to replace.
Previously, if `stub_program_in_path` was invoked for a program that
had already been executed by the test, the original program would still
get invoked rather than the stub (unless `hash` was called or `PATH` was
updated elsewhere).

Per the comments from the 'bats-helpers: {stub,restore}_program_in_path
trigger Bash command rehash' test case:

`restore_program_in_path` unconditionally updates `PATH`, which resets
Bash's executable path hash table. I didn't realize this until calling
`stub_program_in_path` on `rm` and finding that the `rm` stub was only
found when it was the first in a series of programs to be stubbed. After
some trial and error, I realized this was because the
`create_bats_test_script` call invokes `rm` and `stub_program_in_path`
only modifies `PATH` on the first call.

This isn't documented in the Bash man page, but once I figured out what
was happening, my hypothesis was confirmed by:
  https://superuser.com/a/1000317

2796 of 2955 relevant lines covered (94.62%)

249.32 hits per line

Source Files on job 690.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 690
  • Travis Job 690.1
  • 67fe8137 on github
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