annotate 2.4.1.beta1 → 2.5.0.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require 'annotate/annotate_routes'
3
-
4
- describe AnnotateRoutes do
5
-
6
- def mock_file(stubs={})
7
- @mock_file ||= mock(File, stubs)
8
- end
9
-
10
- describe "Annotate Job" do
11
-
12
- before(:each) do
13
- File.should_receive(:join).with("config", "routes.rb").and_return("config/routes.rb")
14
- end
15
-
16
- it "should check if routes.rb exists" do
17
- File.should_receive(:exists?).with("config/routes.rb").and_return(false)
18
- AnnotateRoutes.should_receive(:puts).with("Can`t find routes.rb")
19
- AnnotateRoutes.do_annotate
20
- end
21
-
22
- describe "When Annotating" do
23
-
24
- before(:each) do
25
- File.should_receive(:exists?).with("config/routes.rb").and_return(true)
26
- AnnotateRoutes.should_receive(:`).with("rake routes").and_return("bad line\ngood line")
27
- File.should_receive(:open).with("config/routes.rb", "wb").and_yield(mock_file)
28
- AnnotateRoutes.should_receive(:puts).with("Route file annotated.")
29
- end
30
-
31
- it "should annotate and add a newline!" do
32
- File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo")
33
- @mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n#== Route Map\n# Generated on .*\n#\n# good line/)
34
- AnnotateRoutes.do_annotate
35
- end
36
-
37
- it "should not add a newline if there are empty lines" do
38
- File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo\n")
39
- @mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n#== Route Map\n# Generated on .*\n#\n# good line/)
40
- AnnotateRoutes.do_annotate
41
- end
42
-
43
- end
44
-
45
- end
46
-
47
- end
@@ -1,9 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper.rb'
2
-
3
- describe Annotate do
4
-
5
- it "should have a version" do
6
- Annotate.version.should be_instance_of(String)
7
- end
8
-
9
- end
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --colour
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems'
5
- gem 'rspec-core'
6
- require 'rspec'
7
- end
8
-
9
- $:.unshift(File.dirname(__FILE__) + '/../lib')
10
- require 'annotate'
data/todo.txt DELETED
@@ -1,5 +0,0 @@
1
- TODO
2
- -----
3
- change default position back to "top" for all
4
- add "top" and "bottom" as synonyms for "before" and "after"
5
- change 'exclude' to 'only' (double negatives are not unconfusing)