Permalink
Browse files

Include file in URI validator output.

  • Loading branch information...
1 parent 1b7a6a6 commit b6c56aef18a3b893d083dca10e63dcfb07b8af40 @georgebrock georgebrock committed Jan 10, 2013
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/helpers/uri_validator.rb
  2. +3 −3 spec/uri_validator_spec.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
@@ -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

0 comments on commit b6c56ae

Please sign in to comment.