File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 5
5
{<img src="https://travis-ci.org/ctran/annotate_models.svg?branch=develop" />}[https://travis-ci.org/ctran/annotate_models]
6
6
{<img src="https://coveralls.io/repos/ctran/annotate_models/badge.svg?branch=develop" />}[https://coveralls.io/r/ctran/annotate_models?branch=develop]
7
7
{<img src="https://codeclimate.com/github/ctran/annotate_models/badges/gpa.svg" />}[https://codeclimate.com/github/ctran/annotate_models]
8
+ {<img src="http://inch-ci.org/github/ctran/annotate_models.svg?branch=develop" alt="Inline docs" />}[http://inch-ci.org/github/ctran/annotate_models]
8
9
{<img src="https://gemnasium.com/ctran/annotate_models.png" />}[https://gemnasium.com/ctran/annotate_models]
9
10
10
11
Add a comment summarizing the current schema to the top or bottom of each of
@@ -58,15 +59,15 @@ Into Gemfile from rubygems.org:
58
59
59
60
Into Gemfile from Github:
60
61
61
- gem 'annotate', github : 'ctran/annotate_models'
62
+ gem 'annotate', git : 'https://github.com/ ctran/annotate_models.git '
62
63
63
64
Into environment gems from rubygems.org:
64
65
65
66
gem install annotate
66
67
67
68
Into environment gems from Github checkout:
68
69
69
- git clone git ://github.com/ctran/annotate_models.git annotate_models
70
+ git clone https ://github.com/ctran/annotate_models.git annotate_models
70
71
cd annotate_models
71
72
rake build
72
73
gem install pkg/annotate-*.gem
Original file line number Diff line number Diff line change @@ -41,6 +41,15 @@ def mock_file(stubs={})
41
41
AnnotateRoutes . do_annotations ( ignore_routes : 'my_route' )
42
42
end
43
43
44
+ it 'should insert annotations if file does not contain annotations and position top' do
45
+ expect ( File ) . to receive ( :read ) . with ( ROUTE_FILE ) . and_return ( "" )
46
+ expect ( File ) . to receive ( :open ) . with ( ROUTE_FILE , 'wb' ) . and_yield ( mock_file )
47
+ expect ( @mock_file ) . to receive ( :puts ) . with ( "# == Route Map\n #\n " )
48
+ expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( ANNOTATION_ADDED )
49
+
50
+ AnnotateRoutes . do_annotations ( position_in_routes : 'top' )
51
+ end
52
+
44
53
it 'should skip annotations if file does already contain annotation' do
45
54
expect ( File ) . to receive ( :read ) . with ( ROUTE_FILE ) . and_return ( "\n # == Route Map\n #\n " )
46
55
expect ( AnnotateRoutes ) . to receive ( :puts ) . with ( FILE_UNCHANGED )
You can’t perform that action at this time.
0 commit comments