refining and getting tests for placeholder

This commit is contained in:
Andy Meneely
2021-10-12 23:40:08 -04:00
parent b4d6b2aa0a
commit 9e49b4053a
4 changed files with 46 additions and 10 deletions
+9
View File
@@ -126,4 +126,13 @@ module Squib::Args::ArgLoader
self
end
# Return the deck's configuration
# This keeps the @deck local to this mixin instead of forcing args classes
# to "know" that @deck works.
#
# It also makes unit testing easier. Sue me.
def deck_conf
@deck.conf
end
end
+2 -2
View File
@@ -30,9 +30,9 @@ module Squib::Args
def validate_file(arg, i)
return nil if arg.nil?
return File.expand_path(arg) if File.exists?(arg)
return File.expand_path(placeholder[i]) if File.exists?(placeholder[i])
return File.expand_path(placeholder[i]) if File.exists?(placeholder[i].to_s)
case @deck.conf.img_missing.to_sym
case deck_conf.img_missing.to_sym
when :error
raise "File #{File.expand_path(arg)} does not exist!"
when :warn