Commit 330f8bdb by Alexander Belozerov Committed by Cuong Tran

Remove empty line with trailing space at the end of routes map (#483)

parent 6775e4a1
......@@ -77,7 +77,7 @@ module AnnotateRoutes
end
def self.app_routes_map(options)
routes_map = `rake routes`.split(/\n/, -1)
routes_map = `rake routes`.chomp("\n").split(/\n/, -1)
# In old versions of Rake, the first line of output was the cwd. Not so
# much in newer ones. We ditch that line if it exists, and if not, we
......
......@@ -22,10 +22,10 @@ describe AnnotateRoutes do
expect(File).to receive(:exists?).with(ROUTE_FILE).and_return(true)
expect(File).to receive(:read).with(ROUTE_FILE).and_return("")
expect(AnnotateRoutes).to receive(:`).with('rake routes').and_return(' Prefix Verb URI Pattern Controller#Action
expect(AnnotateRoutes).to receive(:`).with('rake routes').and_return(" Prefix Verb URI Pattern Controller#Action
myaction1 GET /url1(.:format) mycontroller1#action
myaction2 POST /url2(.:format) mycontroller2#action
myaction3 DELETE|GET /url3(.:format) mycontroller3#action')
myaction3 DELETE|GET /url3(.:format) mycontroller3#action\n")
expect(AnnotateRoutes).to receive(:puts).with(ANNOTATION_ADDED)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment