public
Rubygem
Description: Rails generators which produce tests using shoulda instead of straight up Test::Unit. Other goodies as well.
Clone URL: git://github.com/technicalpickles/shoulda_generator.git
Supports should_be_restful now, with choice of a more 'basic' functional 
test.
Wed Jul 02 15:49:06 -0700 2008
commit  d92e98b8820fd3304aea59f4d66a3ec294e6960e
tree    c70e084d2e0a8a0df27c3e1e27ca92bde3ce74c2
parent  a2b67dec909003de1112af37d5440b85073c1bb0
...
1
2
3
4
...
17
18
19
20
 
 
21
22
23
...
 
1
2
3
...
16
17
18
 
19
20
21
22
23
0
@@ -1,4 +1,3 @@
0
-Manifest.txt
0
 rails_generators/shoulda_model/shoulda_model_generator.rb
0
 rails_generators/shoulda_model/templates/factory.rb
0
 rails_generators/shoulda_model/templates/fixtures.yml
0
@@ -17,7 +16,8 @@ rails_generators/shoulda_scaffold/templates/erb/index.html.erb
0
 rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
0
 rails_generators/shoulda_scaffold/templates/erb/new.html.erb
0
 rails_generators/shoulda_scaffold/templates/erb/show.html.erb
0
-rails_generators/shoulda_scaffold/templates/functional_test.rb
0
+rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
0
+rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
0
 rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
0
 rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
0
 rails_generators/shoulda_scaffold/templates/haml/index.html.haml
...
1
2
 
3
4
5
...
63
64
65
66
 
67
68
69
...
76
77
78
 
 
 
 
79
80
81
...
90
91
92
 
93
94
95
...
1
 
2
3
4
5
...
63
64
65
 
66
67
68
69
...
76
77
78
79
80
81
82
83
84
85
...
94
95
96
97
98
99
100
0
@@ -1,5 +1,5 @@
0
 class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
0
- default_options :skip_timestamps => false, :skip_migration => false, :skip_layout => true, :templating => 'haml'
0
+ default_options :skip_timestamps => false, :skip_migration => false, :skip_layout => true, :templating => 'haml', :functional_test_style => 'should_be_restful'
0
 
0
   attr_reader :controller_name,
0
                 :controller_class_path,
0
@@ -63,7 +63,7 @@ class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
0
         'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
0
       )
0
 
0
- m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
0
+ m.template("functional_test/#{functional_test_style}.rb", File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
0
       m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
0
 
0
       m.route_resources controller_file_name
0
@@ -76,6 +76,10 @@ class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
0
     options[:templating]
0
   end
0
 
0
+ def functional_test_style
0
+ options[:functional_test_style]
0
+ end
0
+
0
   protected
0
     # Override with your own usage banner.
0
     def banner
0
@@ -90,6 +94,7 @@ class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
0
       opt.on("--skip-migration",
0
              "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
0
       opt.on("--templating [erb|haml]", "Specify the templating to use (haml by default)") { |v| options[:templating] = v }
0
+ opt.on("--functional-test-style [basic|should_be_restful]", "Specify the style of the functional test (should_be_restful by default)") { |v| options[:functional_test_style] = v }
0
     end
0
 
0
     def scaffold_views
...
1
2
3
4
5
6
 
7
8
 
9
 
 
10
11
12
 
13
14
15
...
20
21
22
23
 
24
25
 
26
27
28
 
29
30
...
 
1
2
3
4
 
5
6
7
8
9
10
11
12
13
 
14
15
16
17
...
22
23
24
 
25
26
 
27
28
29
 
30
31
32
0
@@ -1,15 +1,17 @@
0
-(in /Users/nichoj/Projects/shoulda_generator)
0
 Gem::Specification.new do |s|
0
   s.name = %q{shoulda_generator}
0
   s.version = "0.1.0"
0
 
0
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
0
+ s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
0
   s.authors = ["Josh Nichols"]
0
   s.date = %q{2008-07-02}
0
+ s.description = %q{Generators which create tests using shoulda}
0
   s.email = %q{josh@technicalpickles.com}
0
+ s.extra_rdoc_files = ["README.markdown"]
0
+ s.files = ["rails_generators/shoulda_model/shoulda_model_generator.rb", "rails_generators/shoulda_model/templates/factory.rb", "rails_generators/shoulda_model/templates/fixtures.yml", "rails_generators/shoulda_model/templates/migration.rb", "rails_generators/shoulda_model/templates/model.rb", "rails_generators/shoulda_model/templates/unit_test.rb", "rails_generators/shoulda_model/USAGE", "rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb", "rails_generators/shoulda_scaffold/templates/blueprint/ie.css", "rails_generators/shoulda_scaffold/templates/blueprint/print.css", "rails_generators/shoulda_scaffold/templates/blueprint/screen.css", "rails_generators/shoulda_scaffold/templates/controller.rb", "rails_generators/shoulda_scaffold/templates/erb/_form.html.erb", "rails_generators/shoulda_scaffold/templates/erb/edit.html.erb", "rails_generators/shoulda_scaffold/templates/erb/index.html.erb", "rails_generators/shoulda_scaffold/templates/erb/layout.html.erb", "rails_generators/shoulda_scaffold/templates/erb/new.html.erb", "rails_generators/shoulda_scaffold/templates/erb/show.html.erb", "rails_generators/shoulda_scaffold/templates/functional_test/basic.rb", "rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb", "rails_generators/shoulda_scaffold/templates/haml/_form.html.haml", "rails_generators/shoulda_scaffold/templates/haml/edit.html.haml", "rails_generators/shoulda_scaffold/templates/haml/index.html.haml", "rails_generators/shoulda_scaffold/templates/haml/layout.html.haml", "rails_generators/shoulda_scaffold/templates/haml/new.html.haml", "rails_generators/shoulda_scaffold/templates/haml/show.html.haml", "rails_generators/shoulda_scaffold/templates/helper.rb", "rails_generators/shoulda_scaffold/USAGE", "Rakefile", "README.markdown", "shoulda_generator.gemspec", "Manifest"]
0
   s.has_rdoc = true
0
   s.homepage = %q{http://github.com/technicalpickles/shoulda_generator}
0
- s.rdoc_options = ["--main", "README.txt"]
0
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Shoulda_generator", "--main", "README.markdown"]
0
   s.require_paths = ["lib"]
0
   s.rubyforge_project = %q{shoulda_generator}
0
   s.rubygems_version = %q{1.2.0}
0
@@ -20,11 +22,11 @@ Gem::Specification.new do |s|
0
     s.specification_version = 2
0
 
0
     if current_version >= 3 then
0
- s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
0
+ s.add_development_dependency(%q<echoe>, [">= 0"])
0
     else
0
- s.add_dependency(%q<hoe>, [">= 1.7.0"])
0
+ s.add_dependency(%q<echoe>, [">= 0"])
0
     end
0
   else
0
- s.add_dependency(%q<hoe>, [">= 1.7.0"])
0
+ s.add_dependency(%q<echoe>, [">= 0"])
0
   end
0
 end

Comments

    No one has commented yet.