drd-shoulda_generator 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/LICENSE +20 -0
  2. data/Manifest +32 -0
  3. data/README.markdown +79 -0
  4. data/Rakefile +26 -0
  5. data/TODO +8 -0
  6. data/VERSION.yml +4 -0
  7. data/rails_generators/shoulda_model/USAGE +27 -0
  8. data/rails_generators/shoulda_model/shoulda_model_generator.rb +49 -0
  9. data/rails_generators/shoulda_model/templates/factory.rb +5 -0
  10. data/rails_generators/shoulda_model/templates/fixtures.yml +19 -0
  11. data/rails_generators/shoulda_model/templates/migration.rb +16 -0
  12. data/rails_generators/shoulda_model/templates/model.rb +2 -0
  13. data/rails_generators/shoulda_model/templates/unit_test.rb +7 -0
  14. data/rails_generators/shoulda_scaffold/USAGE +34 -0
  15. data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +168 -0
  16. data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +22 -0
  17. data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +29 -0
  18. data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +226 -0
  19. data/rails_generators/shoulda_scaffold/templates/controller.rb +72 -0
  20. data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +8 -0
  21. data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +12 -0
  22. data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +22 -0
  23. data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +22 -0
  24. data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +8 -0
  25. data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +12 -0
  26. data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +66 -0
  27. data/rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb +13 -0
  28. data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +7 -0
  29. data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +9 -0
  30. data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +18 -0
  31. data/rails_generators/shoulda_scaffold/templates/haml/layout.html.haml +15 -0
  32. data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +7 -0
  33. data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +10 -0
  34. data/rails_generators/shoulda_scaffold/templates/helper.rb +2 -0
  35. data/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
  36. data/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
  37. data/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
  38. data/test/fixtures/eager/zoo.rb +3 -0
  39. data/test/fixtures/eager/zoo/reptile_house.rb +2 -0
  40. data/test/fixtures/environment_with_constant.rb +1 -0
  41. data/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
  42. data/test/fixtures/lib/generators/working/working_generator.rb +2 -0
  43. data/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +4 -0
  44. data/test/fixtures/plugins/default/gemlike/init.rb +1 -0
  45. data/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +2 -0
  46. data/test/fixtures/plugins/default/gemlike/rails/init.rb +7 -0
  47. data/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  48. data/test/fixtures/plugins/default/stubby/about.yml +2 -0
  49. data/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +4 -0
  50. data/test/fixtures/plugins/default/stubby/init.rb +7 -0
  51. data/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
  52. data/test/rails_generators/shoulda_model_generator_test.rb +39 -0
  53. data/test/shoulda_macros/generator_macros.rb +36 -0
  54. data/test/stolen_from_railties.rb +288 -0
  55. data/test/test_helper.rb +41 -0
  56. metadata +154 -0
@@ -0,0 +1,41 @@
1
+ require 'rubygems'
2
+ require 'ruby-debug'
3
+ require 'active_support'
4
+ require 'active_record'
5
+ require 'action_controller'
6
+ require 'action_view'
7
+
8
+ require 'shoulda'
9
+
10
+ require 'mocha'
11
+
12
+ require File.join(File.dirname(__FILE__), 'shoulda_macros', 'generator_macros')
13
+
14
+
15
+
16
+ require File.join(File.dirname(__FILE__), 'stolen_from_railties')
17
+
18
+ unless defined?(RAILS_DEFAULT_LOGGER)
19
+ @test_log = File.join(RAILS_ROOT, 'test.log')
20
+ RAILS_DEFAULT_LOGGER = Logger.new(@test_log)
21
+ end
22
+
23
+ Rails::Generator::Base.prepend_sources Rails::Generator::PathSource.new(:shoulda_generator, File.join(File.dirname(__FILE__), "..", "rails_generators"))
24
+
25
+ class GeneratorTestCase
26
+ # Asserts that the given factory was created.
27
+ def assert_generated_factory_for(name)
28
+ assert_generated_file "test/factories/#{name.to_s.underscore}_factory.rb"
29
+ end
30
+
31
+ # Asserts that the given factory was NOT created.
32
+ def deny_generated_factory_for(name)
33
+ deny_file_exists "test/factories/#{name.to_s.underscore}_factory.rb"
34
+ end
35
+
36
+ # asserts that the given file DOES NOT exists
37
+ def deny_file_exists(path)
38
+ assert ! File.exist?("#{RAILS_ROOT}/#{path}"),
39
+ "The file '#{RAILS_ROOT}/#{path}' should not exist"
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: drd-shoulda_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Josh Nichols
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-16 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Generators which create tests using shoulda
17
+ email: josh@technicalpickles.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.markdown
24
+ - LICENSE
25
+ files:
26
+ - LICENSE
27
+ - Manifest
28
+ - Rakefile
29
+ - README.markdown
30
+ - TODO
31
+ - VERSION.yml
32
+ - rails_generators/shoulda_model
33
+ - rails_generators/shoulda_model/shoulda_model_generator.rb
34
+ - rails_generators/shoulda_model/templates
35
+ - rails_generators/shoulda_model/templates/factory.rb
36
+ - rails_generators/shoulda_model/templates/fixtures.yml
37
+ - rails_generators/shoulda_model/templates/migration.rb
38
+ - rails_generators/shoulda_model/templates/model.rb
39
+ - rails_generators/shoulda_model/templates/unit_test.rb
40
+ - rails_generators/shoulda_model/USAGE
41
+ - rails_generators/shoulda_scaffold
42
+ - rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
43
+ - rails_generators/shoulda_scaffold/templates
44
+ - rails_generators/shoulda_scaffold/templates/blueprint
45
+ - rails_generators/shoulda_scaffold/templates/blueprint/ie.css
46
+ - rails_generators/shoulda_scaffold/templates/blueprint/print.css
47
+ - rails_generators/shoulda_scaffold/templates/blueprint/screen.css
48
+ - rails_generators/shoulda_scaffold/templates/controller.rb
49
+ - rails_generators/shoulda_scaffold/templates/erb
50
+ - rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
51
+ - rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
52
+ - rails_generators/shoulda_scaffold/templates/erb/index.html.erb
53
+ - rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
54
+ - rails_generators/shoulda_scaffold/templates/erb/new.html.erb
55
+ - rails_generators/shoulda_scaffold/templates/erb/show.html.erb
56
+ - rails_generators/shoulda_scaffold/templates/functional_test
57
+ - rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
58
+ - rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
59
+ - rails_generators/shoulda_scaffold/templates/haml
60
+ - rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
61
+ - rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
62
+ - rails_generators/shoulda_scaffold/templates/haml/index.html.haml
63
+ - rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
64
+ - rails_generators/shoulda_scaffold/templates/haml/new.html.haml
65
+ - rails_generators/shoulda_scaffold/templates/haml/show.html.haml
66
+ - rails_generators/shoulda_scaffold/templates/helper.rb
67
+ - rails_generators/shoulda_scaffold/USAGE
68
+ - test/fixtures
69
+ - test/fixtures/about_yml_plugins
70
+ - test/fixtures/about_yml_plugins/bad_about_yml
71
+ - test/fixtures/about_yml_plugins/bad_about_yml/about.yml
72
+ - test/fixtures/about_yml_plugins/bad_about_yml/init.rb
73
+ - test/fixtures/about_yml_plugins/plugin_without_about_yml
74
+ - test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb
75
+ - test/fixtures/eager
76
+ - test/fixtures/eager/zoo
77
+ - test/fixtures/eager/zoo/reptile_house.rb
78
+ - test/fixtures/eager/zoo.rb
79
+ - test/fixtures/environment_with_constant.rb
80
+ - test/fixtures/lib
81
+ - test/fixtures/lib/generators
82
+ - test/fixtures/lib/generators/missing_class
83
+ - test/fixtures/lib/generators/missing_class/missing_class_generator.rb
84
+ - test/fixtures/lib/generators/missing_class/templates
85
+ - test/fixtures/lib/generators/missing_generator
86
+ - test/fixtures/lib/generators/missing_generator/templates
87
+ - test/fixtures/lib/generators/missing_templates
88
+ - test/fixtures/lib/generators/working
89
+ - test/fixtures/lib/generators/working/working_generator.rb
90
+ - test/fixtures/plugins
91
+ - test/fixtures/plugins/alternate
92
+ - test/fixtures/plugins/alternate/a
93
+ - test/fixtures/plugins/alternate/a/generators
94
+ - test/fixtures/plugins/alternate/a/generators/a_generator
95
+ - test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb
96
+ - test/fixtures/plugins/alternate/a/lib
97
+ - test/fixtures/plugins/default
98
+ - test/fixtures/plugins/default/acts
99
+ - test/fixtures/plugins/default/acts/acts_as_chunky_bacon
100
+ - test/fixtures/plugins/default/acts/acts_as_chunky_bacon/lib
101
+ - test/fixtures/plugins/default/empty
102
+ - test/fixtures/plugins/default/gemlike
103
+ - test/fixtures/plugins/default/gemlike/init.rb
104
+ - test/fixtures/plugins/default/gemlike/lib
105
+ - test/fixtures/plugins/default/gemlike/lib/gemlike.rb
106
+ - test/fixtures/plugins/default/gemlike/rails
107
+ - test/fixtures/plugins/default/gemlike/rails/init.rb
108
+ - test/fixtures/plugins/default/plugin_with_no_lib_dir
109
+ - test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb
110
+ - test/fixtures/plugins/default/stubby
111
+ - test/fixtures/plugins/default/stubby/about.yml
112
+ - test/fixtures/plugins/default/stubby/generators
113
+ - test/fixtures/plugins/default/stubby/generators/stubby_generator
114
+ - test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb
115
+ - test/fixtures/plugins/default/stubby/init.rb
116
+ - test/fixtures/plugins/default/stubby/lib
117
+ - test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb
118
+ - test/fixtures/tmp
119
+ - test/fixtures/tmp/test.log
120
+ - test/rails_generators
121
+ - test/rails_generators/shoulda_model_generator_test.rb
122
+ - test/shoulda_macros
123
+ - test/shoulda_macros/generator_macros.rb
124
+ - test/stolen_from_railties.rb
125
+ - test/test_helper.rb
126
+ has_rdoc: true
127
+ homepage: http://github.com/technicalpickles/shoulda_generator
128
+ post_install_message:
129
+ rdoc_options:
130
+ - --inline-source
131
+ - --charset=UTF-8
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: "0"
139
+ version:
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: "0"
145
+ version:
146
+ requirements: []
147
+
148
+ rubyforge_project:
149
+ rubygems_version: 1.2.0
150
+ signing_key:
151
+ specification_version: 2
152
+ summary: Generators which create tests using shoulda
153
+ test_files: []
154
+