lib/aruba/api/core.rb in aruba-2.1.0 vs lib/aruba/api/core.rb in aruba-2.2.0
- old
+ new
@@ -142,11 +142,11 @@
# # => /foo/bar
#
def expand_path(file_name, dir_string = nil)
unless file_name.is_a?(String) && !file_name.empty?
message = "Filename #{file_name} needs to be a string." \
- " It cannot be nil or empty either."\
+ " It cannot be nil or empty either." \
" Please use `expand_path('.')` if you want" \
" the current directory to be expanded."
raise ArgumentError, message
end
@@ -158,11 +158,11 @@
end
prefix = file_name[0]
if prefix == aruba.config.fixtures_path_prefix
- rest = file_name[2..-1]
+ rest = file_name[2..]
path = File.join(*[aruba.fixtures_directory, rest].compact)
unless Aruba.platform.exist? path
aruba_fixture_candidates = aruba.config.fixtures_directories
.map { |p| format('"%s"', p) }.join(", ")
@@ -193,11 +193,11 @@
caller_file_line = "#{caller_location.path}:#{caller_location.lineno}"
message =
"Aruba's `expand_path` method was called with an absolute path" \
" at #{caller_file_line}, which is not recommended." \
" The path passed was '#{file_name}'." \
- " Change the call to pass a relative path or set "\
- "`config.allow_absolute_paths = true` to silence this warning"
+ " Change the call to pass a relative path or set" \
+ " `config.allow_absolute_paths = true` to silence this warning"
raise UserError, message
end
file_name
else
with_environment do