mattyoho-shoulda_generator 0.2.1

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.
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 +150 -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,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mattyoho-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-01-06 00:00:00 -08: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
+
24
+ files:
25
+ - LICENSE
26
+ - Manifest
27
+ - Rakefile
28
+ - README.markdown
29
+ - TODO
30
+ - VERSION.yml
31
+ - rails_generators/shoulda_model
32
+ - rails_generators/shoulda_model/shoulda_model_generator.rb
33
+ - rails_generators/shoulda_model/templates
34
+ - rails_generators/shoulda_model/templates/factory.rb
35
+ - rails_generators/shoulda_model/templates/fixtures.yml
36
+ - rails_generators/shoulda_model/templates/migration.rb
37
+ - rails_generators/shoulda_model/templates/model.rb
38
+ - rails_generators/shoulda_model/templates/unit_test.rb
39
+ - rails_generators/shoulda_model/USAGE
40
+ - rails_generators/shoulda_scaffold
41
+ - rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
42
+ - rails_generators/shoulda_scaffold/templates
43
+ - rails_generators/shoulda_scaffold/templates/blueprint
44
+ - rails_generators/shoulda_scaffold/templates/blueprint/ie.css
45
+ - rails_generators/shoulda_scaffold/templates/blueprint/print.css
46
+ - rails_generators/shoulda_scaffold/templates/blueprint/screen.css
47
+ - rails_generators/shoulda_scaffold/templates/controller.rb
48
+ - rails_generators/shoulda_scaffold/templates/erb
49
+ - rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
50
+ - rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
51
+ - rails_generators/shoulda_scaffold/templates/erb/index.html.erb
52
+ - rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
53
+ - rails_generators/shoulda_scaffold/templates/erb/new.html.erb
54
+ - rails_generators/shoulda_scaffold/templates/erb/show.html.erb
55
+ - rails_generators/shoulda_scaffold/templates/functional_test
56
+ - rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
57
+ - rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
58
+ - rails_generators/shoulda_scaffold/templates/haml
59
+ - rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
60
+ - rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
61
+ - rails_generators/shoulda_scaffold/templates/haml/index.html.haml
62
+ - rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
63
+ - rails_generators/shoulda_scaffold/templates/haml/new.html.haml
64
+ - rails_generators/shoulda_scaffold/templates/haml/show.html.haml
65
+ - rails_generators/shoulda_scaffold/templates/helper.rb
66
+ - rails_generators/shoulda_scaffold/USAGE
67
+ - test/fixtures
68
+ - test/fixtures/about_yml_plugins
69
+ - test/fixtures/about_yml_plugins/bad_about_yml
70
+ - test/fixtures/about_yml_plugins/bad_about_yml/about.yml
71
+ - test/fixtures/about_yml_plugins/bad_about_yml/init.rb
72
+ - test/fixtures/about_yml_plugins/plugin_without_about_yml
73
+ - test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb
74
+ - test/fixtures/eager
75
+ - test/fixtures/eager/zoo
76
+ - test/fixtures/eager/zoo/reptile_house.rb
77
+ - test/fixtures/eager/zoo.rb
78
+ - test/fixtures/environment_with_constant.rb
79
+ - test/fixtures/lib
80
+ - test/fixtures/lib/generators
81
+ - test/fixtures/lib/generators/missing_class
82
+ - test/fixtures/lib/generators/missing_class/missing_class_generator.rb
83
+ - test/fixtures/lib/generators/missing_class/templates
84
+ - test/fixtures/lib/generators/missing_generator
85
+ - test/fixtures/lib/generators/missing_generator/templates
86
+ - test/fixtures/lib/generators/missing_templates
87
+ - test/fixtures/lib/generators/working
88
+ - test/fixtures/lib/generators/working/working_generator.rb
89
+ - test/fixtures/plugins
90
+ - test/fixtures/plugins/alternate
91
+ - test/fixtures/plugins/alternate/a
92
+ - test/fixtures/plugins/alternate/a/generators
93
+ - test/fixtures/plugins/alternate/a/generators/a_generator
94
+ - test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb
95
+ - test/fixtures/plugins/alternate/a/lib
96
+ - test/fixtures/plugins/default
97
+ - test/fixtures/plugins/default/acts
98
+ - test/fixtures/plugins/default/acts/acts_as_chunky_bacon
99
+ - test/fixtures/plugins/default/acts/acts_as_chunky_bacon/lib
100
+ - test/fixtures/plugins/default/empty
101
+ - test/fixtures/plugins/default/gemlike
102
+ - test/fixtures/plugins/default/gemlike/init.rb
103
+ - test/fixtures/plugins/default/gemlike/lib
104
+ - test/fixtures/plugins/default/gemlike/lib/gemlike.rb
105
+ - test/fixtures/plugins/default/gemlike/rails
106
+ - test/fixtures/plugins/default/gemlike/rails/init.rb
107
+ - test/fixtures/plugins/default/plugin_with_no_lib_dir
108
+ - test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb
109
+ - test/fixtures/plugins/default/stubby
110
+ - test/fixtures/plugins/default/stubby/about.yml
111
+ - test/fixtures/plugins/default/stubby/generators
112
+ - test/fixtures/plugins/default/stubby/generators/stubby_generator
113
+ - test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb
114
+ - test/fixtures/plugins/default/stubby/init.rb
115
+ - test/fixtures/plugins/default/stubby/lib
116
+ - test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb
117
+ - test/rails_generators
118
+ - test/rails_generators/shoulda_model_generator_test.rb
119
+ - test/shoulda_macros
120
+ - test/shoulda_macros/generator_macros.rb
121
+ - test/stolen_from_railties.rb
122
+ - test/test_helper.rb
123
+ has_rdoc: false
124
+ homepage: http://github.com/technicalpickles/shoulda_generator
125
+ post_install_message:
126
+ rdoc_options: []
127
+
128
+ require_paths:
129
+ - lib
130
+ required_ruby_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: "0"
135
+ version:
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: "0"
141
+ version:
142
+ requirements: []
143
+
144
+ rubyforge_project:
145
+ rubygems_version: 1.2.0
146
+ signing_key:
147
+ specification_version: 3
148
+ summary: Generators which create tests using shoulda
149
+ test_files: []
150
+