stefanpenner-my_generator 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/Manifest +32 -0
- data/README.markdown +4 -0
- data/Rakefile +26 -0
- data/TODO +0 -0
- data/VERSION.yml +4 -0
- data/rails_generators/shoulda_model/USAGE +27 -0
- data/rails_generators/shoulda_model/shoulda_model_generator.rb +49 -0
- data/rails_generators/shoulda_model/templates/factory.rb +5 -0
- data/rails_generators/shoulda_model/templates/fixtures.yml +19 -0
- data/rails_generators/shoulda_model/templates/migration.rb +16 -0
- data/rails_generators/shoulda_model/templates/model.rb +2 -0
- data/rails_generators/shoulda_model/templates/unit_test.rb +7 -0
- data/rails_generators/shoulda_scaffold/USAGE +34 -0
- data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +168 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +22 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +29 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +249 -0
- data/rails_generators/shoulda_scaffold/templates/controller.rb +46 -0
- data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +12 -0
- data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +22 -0
- data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +22 -0
- data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +12 -0
- data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +66 -0
- data/rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb +13 -0
- data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +5 -0
- data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +9 -0
- data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +18 -0
- data/rails_generators/shoulda_scaffold/templates/haml/layout.html.haml +13 -0
- data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +7 -0
- data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +9 -0
- data/rails_generators/shoulda_scaffold/templates/helper.rb +2 -0
- data/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
- data/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
- data/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
- data/test/fixtures/eager/zoo.rb +3 -0
- data/test/fixtures/eager/zoo/reptile_house.rb +2 -0
- data/test/fixtures/environment_with_constant.rb +1 -0
- data/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/test/fixtures/lib/generators/working/working_generator.rb +2 -0
- data/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +4 -0
- data/test/fixtures/plugins/default/gemlike/init.rb +1 -0
- data/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +2 -0
- data/test/fixtures/plugins/default/gemlike/rails/init.rb +7 -0
- data/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/test/fixtures/plugins/default/stubby/about.yml +2 -0
- data/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +4 -0
- data/test/fixtures/plugins/default/stubby/init.rb +7 -0
- data/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
- data/test/fixtures/tmp/test.log +1 -0
- data/test/rails_generators/shoulda_model_generator_test.rb +39 -0
- data/test/shoulda_macros/generator_macros.rb +36 -0
- data/test/stolen_from_railties.rb +288 -0
- data/test/test_helper.rb +41 -0
- metadata +145 -0
data/test/test_helper.rb
ADDED
@@ -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,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stefanpenner-my_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josh Nichols
|
8
|
+
- Stefan Penner
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-01-07 00:00:00 -08:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: Generators which create tests using shoulda
|
18
|
+
email: stefan.penner@gmail.com
|
19
|
+
executables: []
|
20
|
+
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
25
|
+
files:
|
26
|
+
- LICENSE
|
27
|
+
- Manifest
|
28
|
+
- Rakefile
|
29
|
+
- README.markdown
|
30
|
+
- TODO
|
31
|
+
- VERSION.yml
|
32
|
+
- test/fixtures
|
33
|
+
- test/fixtures/about_yml_plugins
|
34
|
+
- test/fixtures/about_yml_plugins/bad_about_yml
|
35
|
+
- test/fixtures/about_yml_plugins/bad_about_yml/about.yml
|
36
|
+
- test/fixtures/about_yml_plugins/bad_about_yml/init.rb
|
37
|
+
- test/fixtures/about_yml_plugins/plugin_without_about_yml
|
38
|
+
- test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb
|
39
|
+
- test/fixtures/eager
|
40
|
+
- test/fixtures/eager/zoo
|
41
|
+
- test/fixtures/eager/zoo/reptile_house.rb
|
42
|
+
- test/fixtures/eager/zoo.rb
|
43
|
+
- test/fixtures/environment_with_constant.rb
|
44
|
+
- test/fixtures/lib
|
45
|
+
- test/fixtures/lib/generators
|
46
|
+
- test/fixtures/lib/generators/missing_class
|
47
|
+
- test/fixtures/lib/generators/missing_class/missing_class_generator.rb
|
48
|
+
- test/fixtures/lib/generators/missing_class/templates
|
49
|
+
- test/fixtures/lib/generators/missing_generator
|
50
|
+
- test/fixtures/lib/generators/missing_generator/templates
|
51
|
+
- test/fixtures/lib/generators/missing_templates
|
52
|
+
- test/fixtures/lib/generators/working
|
53
|
+
- test/fixtures/lib/generators/working/working_generator.rb
|
54
|
+
- test/fixtures/plugins
|
55
|
+
- test/fixtures/plugins/alternate
|
56
|
+
- test/fixtures/plugins/alternate/a
|
57
|
+
- test/fixtures/plugins/alternate/a/generators
|
58
|
+
- test/fixtures/plugins/alternate/a/generators/a_generator
|
59
|
+
- test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb
|
60
|
+
- test/fixtures/plugins/alternate/a/lib
|
61
|
+
- test/fixtures/plugins/default
|
62
|
+
- test/fixtures/plugins/default/acts
|
63
|
+
- test/fixtures/plugins/default/acts/acts_as_chunky_bacon
|
64
|
+
- test/fixtures/plugins/default/acts/acts_as_chunky_bacon/lib
|
65
|
+
- test/fixtures/plugins/default/empty
|
66
|
+
- test/fixtures/plugins/default/gemlike
|
67
|
+
- test/fixtures/plugins/default/gemlike/init.rb
|
68
|
+
- test/fixtures/plugins/default/gemlike/lib
|
69
|
+
- test/fixtures/plugins/default/gemlike/lib/gemlike.rb
|
70
|
+
- test/fixtures/plugins/default/gemlike/rails
|
71
|
+
- test/fixtures/plugins/default/gemlike/rails/init.rb
|
72
|
+
- test/fixtures/plugins/default/plugin_with_no_lib_dir
|
73
|
+
- test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb
|
74
|
+
- test/fixtures/plugins/default/stubby
|
75
|
+
- test/fixtures/plugins/default/stubby/about.yml
|
76
|
+
- test/fixtures/plugins/default/stubby/generators
|
77
|
+
- test/fixtures/plugins/default/stubby/generators/stubby_generator
|
78
|
+
- test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb
|
79
|
+
- test/fixtures/plugins/default/stubby/init.rb
|
80
|
+
- test/fixtures/plugins/default/stubby/lib
|
81
|
+
- test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb
|
82
|
+
- test/fixtures/tmp
|
83
|
+
- test/fixtures/tmp/test.log
|
84
|
+
- test/rails_generators
|
85
|
+
- test/rails_generators/shoulda_model_generator_test.rb
|
86
|
+
- test/shoulda_macros
|
87
|
+
- test/shoulda_macros/generator_macros.rb
|
88
|
+
- test/stolen_from_railties.rb
|
89
|
+
- test/test_helper.rb
|
90
|
+
- rails_generators/shoulda_model/shoulda_model_generator.rb
|
91
|
+
- rails_generators/shoulda_model/templates/factory.rb
|
92
|
+
- rails_generators/shoulda_model/templates/fixtures.yml
|
93
|
+
- rails_generators/shoulda_model/templates/migration.rb
|
94
|
+
- rails_generators/shoulda_model/templates/model.rb
|
95
|
+
- rails_generators/shoulda_model/templates/unit_test.rb
|
96
|
+
- rails_generators/shoulda_model/USAGE
|
97
|
+
- rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
|
98
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/ie.css
|
99
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/print.css
|
100
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/screen.css
|
101
|
+
- rails_generators/shoulda_scaffold/templates/controller.rb
|
102
|
+
- rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
|
103
|
+
- rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
|
104
|
+
- rails_generators/shoulda_scaffold/templates/erb/index.html.erb
|
105
|
+
- rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
|
106
|
+
- rails_generators/shoulda_scaffold/templates/erb/new.html.erb
|
107
|
+
- rails_generators/shoulda_scaffold/templates/erb/show.html.erb
|
108
|
+
- rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
|
109
|
+
- rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
|
110
|
+
- rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
|
111
|
+
- rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
|
112
|
+
- rails_generators/shoulda_scaffold/templates/haml/index.html.haml
|
113
|
+
- rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
|
114
|
+
- rails_generators/shoulda_scaffold/templates/haml/new.html.haml
|
115
|
+
- rails_generators/shoulda_scaffold/templates/haml/show.html.haml
|
116
|
+
- rails_generators/shoulda_scaffold/templates/helper.rb
|
117
|
+
- rails_generators/shoulda_scaffold/USAGE
|
118
|
+
has_rdoc: false
|
119
|
+
homepage: http://github.com/stefanpenner/my_generator
|
120
|
+
post_install_message:
|
121
|
+
rdoc_options: []
|
122
|
+
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: "0"
|
130
|
+
version:
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: "0"
|
136
|
+
version:
|
137
|
+
requirements: []
|
138
|
+
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 1.2.0
|
141
|
+
signing_key:
|
142
|
+
specification_version: 2
|
143
|
+
summary: Generators which create tests using shoulda
|
144
|
+
test_files: []
|
145
|
+
|