Skip to content

Commit

Permalink
Merge pull request #429 from BBC-News/issue405
Browse files Browse the repository at this point in the history
fix #405
  • Loading branch information
ChrisBAshton committed May 16, 2016
2 parents e72b7a3 + 0a3c1ed commit b578306
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/wraith/helpers/custom_exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ class InvalidDomainsError < CustomError

class MissingRequiredPropertyError < CustomError
end

class ConfigFileDoesNotExistError < CustomError
end
2 changes: 1 addition & 1 deletion lib/wraith/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Wraith
VERSION = "3.1.6"
VERSION = "3.1.7"
end
3 changes: 1 addition & 2 deletions lib/wraith/wraith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def open_config_file(config_name)
return YAML.load config
end
end
rescue
logger.error "unable to find config \"#{config_name}\""
fail ConfigFileDoesNotExistError, "unable to find config \"#{config_name}\""
end

def directory
Expand Down
4 changes: 4 additions & 0 deletions spec/validate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
config["browser"] = nil
expect { Wraith::Validate.new(config, true).validate }.to raise_error MissingRequiredPropertyError
end

it "should complain if the config file doesn't exist" do
expect { Wraith::Wraith.new('configs/some_made_up_config.yml') }.to raise_error ConfigFileDoesNotExistError
end
end

describe "validation specific to capture mode" do
Expand Down

0 comments on commit b578306

Please sign in to comment.