-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from nicolas-brousse/improve-errors
Raise better error when mjml binary is not found
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require_relative 'spec_helper' | ||
require 'mjml' | ||
|
||
describe 'MJML' do | ||
describe '#extract_executable_version' do | ||
it 'should return the version if mjml is installed' do | ||
MJML.extract_executable_version.must_be_instance_of String | ||
end | ||
|
||
it 'should return false for unknown feature' do | ||
bin_path = MJML.config.bin_path | ||
MJML.config.bin_path = '/usr/bin/env mjml-not-installed' | ||
|
||
error = -> { MJML.extract_executable_version }.must_raise MJML::BinaryNotFound | ||
error.message.must_match(/^mjml binary not found/) | ||
|
||
MJML.config.bin_path = bin_path | ||
end | ||
end | ||
end |