@@ -28,7 +28,7 @@ def magic_comments_list_each
28
28
end
29
29
30
30
it 'should check if routes.rb exists' do
31
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE ) . and_return ( false )
31
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE ) . and_return ( false )
32
32
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( "Can't find routes.rb" )
33
33
AnnotateRoutes . do_annotations
34
34
end
@@ -42,7 +42,7 @@ def magic_comments_list_each
42
42
end
43
43
44
44
before ( :each ) do
45
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE ) . and_return ( true ) . at_least ( :once )
45
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE ) . and_return ( true ) . at_least ( :once )
46
46
47
47
expect ( File ) . to receive ( :read ) . with ( ROUTE_FILE ) . and_return ( "" ) . at_least ( :once )
48
48
@@ -164,7 +164,7 @@ def magic_comments_list_each
164
164
165
165
describe 'When adding' do
166
166
before ( :each ) do
167
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE )
167
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE )
168
168
. and_return ( true ) . at_least ( :once )
169
169
expect ( AnnotateRoutes ) . to receive ( :` ) . with ( 'rake routes' )
170
170
. and_return ( '' ) . at_least ( :once )
@@ -243,7 +243,7 @@ def magic_comments_list_each
243
243
244
244
describe 'When adding with older Rake versions' do
245
245
before ( :each ) do
246
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE ) . and_return ( true )
246
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE ) . and_return ( true )
247
247
expect ( AnnotateRoutes ) . to receive ( :` ) . with ( 'rake routes' ) . and_return ( "(in /bad/line)\n good line" )
248
248
expect ( File ) . to receive ( :open ) . with ( ROUTE_FILE , 'wb' ) . and_yield ( mock_file )
249
249
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( ANNOTATION_ADDED )
@@ -264,7 +264,7 @@ def magic_comments_list_each
264
264
265
265
describe 'When adding with newer Rake versions' do
266
266
before ( :each ) do
267
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE ) . and_return ( true )
267
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE ) . and_return ( true )
268
268
expect ( AnnotateRoutes ) . to receive ( :` ) . with ( 'rake routes' ) . and_return ( "another good line\n good line" )
269
269
expect ( File ) . to receive ( :open ) . with ( ROUTE_FILE , 'wb' ) . and_yield ( mock_file )
270
270
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( ANNOTATION_ADDED )
@@ -291,7 +291,7 @@ def magic_comments_list_each
291
291
292
292
describe 'When removing' do
293
293
before ( :each ) do
294
- expect ( File ) . to receive ( :exists ? ) . with ( ROUTE_FILE ) . and_return ( true )
294
+ expect ( File ) . to receive ( :exist ? ) . with ( ROUTE_FILE ) . and_return ( true )
295
295
expect ( File ) . to receive ( :open ) . with ( ROUTE_FILE , 'wb' ) . and_yield ( mock_file )
296
296
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( ANNOTATION_REMOVED )
297
297
end
0 commit comments