File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ def mock_file(stubs={})
32
32
AnnotateRoutes . do_annotations
33
33
end
34
34
35
+ it 'should insert annotations if file does not contain annotations and ignore routes' do
36
+ expect ( File ) . to receive ( :read ) . with ( ROUTE_FILE ) . and_return ( "" )
37
+ expect ( File ) . to receive ( :open ) . with ( ROUTE_FILE , 'wb' ) . and_yield ( mock_file )
38
+ expect ( @mock_file ) . to receive ( :puts ) . with ( "\n # == Route Map\n #\n " )
39
+ expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( ANNOTATION_ADDED )
40
+
41
+ AnnotateRoutes . do_annotations ( ignore_routes : 'my_route' )
42
+ end
43
+
35
44
it 'should skip annotations if file does already contain annotation' do
36
45
expect ( File ) . to receive ( :read ) . with ( ROUTE_FILE ) . and_return ( "\n # == Route Map\n #\n " )
37
46
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( FILE_UNCHANGED )
You can’t perform that action at this time.
0 commit comments