Commit bb8cdf84 by Guillermo Guerrero Ibarra Committed by Cuong Tran

Force https git readme, added ruby docs badge. (#421)

parent e2b250b5
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
{<img src="https://travis-ci.org/ctran/annotate_models.svg?branch=develop" />}[https://travis-ci.org/ctran/annotate_models] {<img src="https://travis-ci.org/ctran/annotate_models.svg?branch=develop" />}[https://travis-ci.org/ctran/annotate_models]
{<img src="https://coveralls.io/repos/ctran/annotate_models/badge.svg?branch=develop" />}[https://coveralls.io/r/ctran/annotate_models?branch=develop] {<img src="https://coveralls.io/repos/ctran/annotate_models/badge.svg?branch=develop" />}[https://coveralls.io/r/ctran/annotate_models?branch=develop]
{<img src="https://codeclimate.com/github/ctran/annotate_models/badges/gpa.svg" />}[https://codeclimate.com/github/ctran/annotate_models] {<img src="https://codeclimate.com/github/ctran/annotate_models/badges/gpa.svg" />}[https://codeclimate.com/github/ctran/annotate_models]
{<img src="http://inch-ci.org/github/ctran/annotate_models.svg?branch=develop" alt="Inline docs" />}[http://inch-ci.org/github/ctran/annotate_models]
{<img src="https://gemnasium.com/ctran/annotate_models.png" />}[https://gemnasium.com/ctran/annotate_models] {<img src="https://gemnasium.com/ctran/annotate_models.png" />}[https://gemnasium.com/ctran/annotate_models]
Add a comment summarizing the current schema to the top or bottom of each of Add a comment summarizing the current schema to the top or bottom of each of
...@@ -58,7 +59,7 @@ Into Gemfile from rubygems.org: ...@@ -58,7 +59,7 @@ Into Gemfile from rubygems.org:
Into Gemfile from Github: Into Gemfile from Github:
gem 'annotate', github: 'ctran/annotate_models' gem 'annotate', git: 'https://github.com/ctran/annotate_models.git'
Into environment gems from rubygems.org: Into environment gems from rubygems.org:
...@@ -66,7 +67,7 @@ Into environment gems from rubygems.org: ...@@ -66,7 +67,7 @@ Into environment gems from rubygems.org:
Into environment gems from Github checkout: Into environment gems from Github checkout:
git clone git://github.com/ctran/annotate_models.git annotate_models git clone https://github.com/ctran/annotate_models.git annotate_models
cd annotate_models cd annotate_models
rake build rake build
gem install pkg/annotate-*.gem gem install pkg/annotate-*.gem
......
...@@ -41,6 +41,15 @@ describe AnnotateRoutes do ...@@ -41,6 +41,15 @@ describe AnnotateRoutes do
AnnotateRoutes.do_annotations(ignore_routes: 'my_route') AnnotateRoutes.do_annotations(ignore_routes: 'my_route')
end end
it 'should insert annotations if file does not contain annotations and position top' do
expect(File).to receive(:read).with(ROUTE_FILE).and_return("")
expect(File).to receive(:open).with(ROUTE_FILE, 'wb').and_yield(mock_file)
expect(@mock_file).to receive(:puts).with("# == Route Map\n#\n")
expect(AnnotateRoutes).to receive(:puts).with(ANNOTATION_ADDED)
AnnotateRoutes.do_annotations(position_in_routes: 'top')
end
it 'should skip annotations if file does already contain annotation' do it 'should skip annotations if file does already contain annotation' do
expect(File).to receive(:read).with(ROUTE_FILE).and_return("\n# == Route Map\n#\n") expect(File).to receive(:read).with(ROUTE_FILE).and_return("\n# == Route Map\n#\n")
expect(AnnotateRoutes).to receive(:puts).with(FILE_UNCHANGED) expect(AnnotateRoutes).to receive(:puts).with(FILE_UNCHANGED)
......
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