Permalink
Browse files

Rename AnnotateRoutes.do_annotate to AnnotateRoutes.do_annotations fo…

…r consistency.
  • Loading branch information...
1 parent d47092e commit 6f62d0e640ef93c95a810c640a8a514b3299e91b @MrJoy MrJoy committed Aug 27, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −1 lib/annotate/annotate_routes.rb
  2. +1 −1 lib/tasks/annotate_routes.rake
  3. +5 −5 spec/annotate/annotate_routes_spec.rb
View
2 lib/annotate/annotate_routes.rb
@@ -20,7 +20,7 @@
module AnnotateRoutes
PREFIX = "# == Route Map"
- def self.do_annotate(options={})
+ def self.do_annotations(options={})
return unless(routes_exists?)
if options[:require]
View
2 lib/tasks/annotate_routes.rake
@@ -7,7 +7,7 @@ task :annotate_routes => :environment do
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
options[:position_in_routes] = Annotate.fallback(ENV['position_in_routes'], ENV['position'])
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
- AnnotateRoutes.do_annotate(options)
+ AnnotateRoutes.do_annotations(options)
end
desc "Removes the route map from routes.rb"
View
10 spec/annotate/annotate_routes_spec.rb
@@ -10,7 +10,7 @@ def mock_file(stubs={})
it "should check if routes.rb exists" do
File.should_receive(:exists?).with("config/routes.rb").and_return(false)
AnnotateRoutes.should_receive(:puts).with("Can`t find routes.rb")
- AnnotateRoutes.do_annotate
+ AnnotateRoutes.do_annotations
end
describe "When Annotating, with older Rake Versions" do
@@ -25,13 +25,13 @@ def mock_file(stubs={})
it "should annotate and add a newline!" do
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo")
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# good line\n/)
- AnnotateRoutes.do_annotate
+ AnnotateRoutes.do_annotations
end
it "should not add a newline if there are empty lines" do
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo\n")
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# good line\n/)
- AnnotateRoutes.do_annotate
+ AnnotateRoutes.do_annotations
end
end
@@ -48,13 +48,13 @@ def mock_file(stubs={})
it "should annotate and add a newline!" do
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo")
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# another good line\n# good line\n/)
- AnnotateRoutes.do_annotate
+ AnnotateRoutes.do_annotations
end
it "should not add a newline if there are empty lines" do
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo\n")
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# another good line\n# good line\n/)
- AnnotateRoutes.do_annotate
+ AnnotateRoutes.do_annotations
end
end

0 comments on commit 6f62d0e

Please sign in to comment.