Skip to content

Commit 7fccc55

Browse files
committed
don't show ? for unknown bin version in message about inability to determine version
1 parent d2d0d4a commit 7fccc55

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## unreleased
44

5+
* Don't show `?` for unknown bin version in message about inability to determine version [@toy](https://github.com/toy)
56
* Deduplicate bin resolving error messages [@toy](https://github.com/toy)
67

78
## v0.24.0 (2016-08-14)

lib/image_optim/bin_resolver/bin.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def to_s
4848

4949
# Fail if version will not work properly
5050
def check_fail!
51-
fail UnknownVersion, "didn't get version of #{self}" unless version
51+
unless version
52+
fail UnknownVersion, "could not get version of #{name} at #{path}"
53+
end
5254

5355
FAIL_CHECKS.each do |bin_name, matcher, message|
5456
next unless bin_name == name

spec/image_optim/bin_resolver_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def raises_error(error_message)
255255
5.times do
256256
expect do
257257
resolver.resolve!(:pngcrush)
258-
end.to raise_error Bin::UnknownVersion
258+
end.to raise_error Bin::UnknownVersion, %r{pngcrush at /bin/pngcrush}
259259
end
260260
end
261261

0 commit comments

Comments
 (0)