Skip to content

Commit

Permalink
Merge pull request #920 from nanoc/improve-fog-trailing-slash-error-m…
Browse files Browse the repository at this point in the history
…essage

Improve trailing-slash error message
  • Loading branch information
denisdefreyne committed Jul 24, 2016
2 parents af3e05c + 83fe7e3 commit c82d2ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/nanoc/extra/deployers/fog.rb
Expand Up @@ -84,8 +84,9 @@ def run
path = config[:path]
cdn_id = config[:cdn_id]

# FIXME: confusing error message
raise 'The path requires no trailing slash' if path && path[-1, 1] == '/'
if path && path.end_with?('/')
raise "The path `#{path}` is not supposed to have a trailing slash"
end

connection = connect
directory = get_or_create_bucket(connection, bucket, path)
Expand Down
2 changes: 1 addition & 1 deletion spec/nanoc/extra/deployers/fog_spec.rb
Expand Up @@ -85,7 +85,7 @@
end

it 'raises' do
expect { subject }.to raise_error('The path requires no trailing slash')
expect { subject }.to raise_error('The path `foo/` is not supposed to have a trailing slash')
end
end

Expand Down

0 comments on commit c82d2ae

Please sign in to comment.