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

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

Build:
Build:
LAST BUILD BRANCH: multiple-script-dirs
DEFAULT BRANCH: master
Ran 31 Aug 2017 08:25PM UTC
Jobs 1
Files 61
Run time 219min
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

pending completion
690

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

1 of 1 new or added line in 1 file covered. (100.0%)

2796 of 2955 relevant lines covered (94.62%)

249.32 hits per line

Jobs
ID Job ID Ran Files Coverage
1 690.1 01 Sep 2017 12:01AM UTC 0
94.62
Travis Job 690.1
Source Files on build 690
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #690
  • 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