refining and getting tests for placeholder
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user