Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Include file in URI validator output.

  • Loading branch information...
commit b6c56aef18a3b893d083dca10e63dcfb07b8af40 1 parent 1b7a6a6
@georgebrock georgebrock authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  lib/helpers/uri_validator.rb
  2. +3 −3 spec/uri_validator_spec.rb
View
2  lib/helpers/uri_validator.rb
@@ -33,6 +33,6 @@ def print_progress_marker
end
def print_error_message(uri)
- puts "\nERROR: #{uri} cannot be found"
+ puts "\nERROR in #{File.basename(@file_name)}: #{uri} cannot be found"
end
end
View
6 spec/uri_validator_spec.rb
@@ -19,7 +19,7 @@
it 'outputs an error for each invalid URI' do
stub_request(:head, 'http://bad.example.org').to_raise(SocketError)
stub_request(:head, 'http://thoughtbot.com/404').to_return(status: 404)
- file_name = 'bad_json_file.json'
+ file_name = 'path/to/bad_json_file.json'
URIExtractor.stubs(:new).with(file_name).returns %w(
http://bad.example.org
http://thoughtbot.com/404
@@ -28,7 +28,7 @@
URIValidator.new(file_name).run
- io.string.should =~ %r{ERROR: http://bad\.example\.org}
- io.string.should =~ %r{ERROR: http://thoughtbot\.com/404}
+ io.string.should =~ %r{ERROR in bad_json_file\.json: http://bad\.example\.org}
+ io.string.should =~ %r{ERROR in bad_json_file\.json: http://thoughtbot\.com/404}
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.