From e4dfba03a2900b6193763a6d57c0023eb0e8f5b2 Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Fri, 22 Apr 2016 16:01:55 +0100 Subject: [PATCH 1/3] fix #405 --- lib/wraith/helpers/custom_exceptions.rb | 3 +++ lib/wraith/wraith.rb | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/wraith/helpers/custom_exceptions.rb b/lib/wraith/helpers/custom_exceptions.rb index 9431dc10..91dfd86d 100644 --- a/lib/wraith/helpers/custom_exceptions.rb +++ b/lib/wraith/helpers/custom_exceptions.rb @@ -6,3 +6,6 @@ class InvalidDomainsError < CustomError class MissingRequiredPropertyError < CustomError end + +class ConfigFileDoesNotExistError < CustomError +end diff --git a/lib/wraith/wraith.rb b/lib/wraith/wraith.rb index d4044d94..a689dbf3 100644 --- a/lib/wraith/wraith.rb +++ b/lib/wraith/wraith.rb @@ -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 From 25757a1729a8afc8883988bf9d1bd032bd98fbb9 Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Mon, 16 May 2016 13:39:51 +0100 Subject: [PATCH 2/3] added test --- spec/validate_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/validate_spec.rb b/spec/validate_spec.rb index 9aad5a42..b63ba529 100644 --- a/spec/validate_spec.rb +++ b/spec/validate_spec.rb @@ -24,6 +24,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 From 395c3e70e1a0096af0d9f3d33026bfd8f10d20ee Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Mon, 16 May 2016 13:41:47 +0100 Subject: [PATCH 3/3] incremented to 3.1.7 --- lib/wraith/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wraith/version.rb b/lib/wraith/version.rb index bcda1698..601129c0 100644 --- a/lib/wraith/version.rb +++ b/lib/wraith/version.rb @@ -1,3 +1,3 @@ module Wraith - VERSION = "3.1.4" + VERSION = "3.1.7" end