shoulda_matchmakers 0.1.0
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +21 -0
- data/lib/controller/action_controller/action_controller_controller_sm_model.rb +53 -0
- data/lib/controller/action_controller/action_controller_controller_sm_model_helper.rb +73 -0
- data/lib/controller/action_controller/matchmakers/callbacks.rb +56 -0
- data/lib/controller/action_controller/matchmakers/filter_param.rb +69 -0
- data/lib/controller/action_controller/matchmakers/permit.rb +510 -0
- data/lib/controller/action_controller/matchmakers/redirect_to.rb +126 -0
- data/lib/controller/action_controller/matchmakers/render_template.rb +198 -0
- data/lib/controller/action_controller/matchmakers/render_with_layout.rb +72 -0
- data/lib/controller/action_controller/matchmakers/rescue_from.rb +96 -0
- data/lib/controller/action_controller/matchmakers/respond_with.rb +71 -0
- data/lib/controller/action_controller/matchmakers/route.rb +586 -0
- data/lib/controller/action_controller/matchmakers/set_flash.rb +136 -0
- data/lib/controller/action_controller/matchmakers/set_session.rb +115 -0
- data/lib/controller/action_controller/permitted_params_definition.rb +60 -0
- data/lib/generators/shoulda_matchmakers/controller_matcher_generator.rb +87 -0
- data/lib/generators/shoulda_matchmakers/controller_matcher_generator_helper.rb +92 -0
- data/lib/generators/shoulda_matchmakers/factory_generator.rb +86 -0
- data/lib/generators/shoulda_matchmakers/install_generator.rb +10 -0
- data/lib/generators/shoulda_matchmakers/model_matcher_generator.rb +87 -0
- data/lib/generators/shoulda_matchmakers/model_matcher_generator_helper.rb +107 -0
- data/lib/model/active_record/active_record_model_sm_model.rb +50 -0
- data/lib/model/active_record/active_record_model_sm_model_helper.rb +206 -0
- data/lib/model/active_record/factory_sm_model.rb +28 -0
- data/lib/model/active_record/factory_sm_model_helper.rb +124 -0
- data/lib/model/active_record/matchmakers/accept_nested_attributes_for.rb +66 -0
- data/lib/model/active_record/matchmakers/allow_value.rb +137 -0
- data/lib/model/active_record/matchmakers/associations.rb +52 -0
- data/lib/model/active_record/matchmakers/define_enum_for.rb +53 -0
- data/lib/model/active_record/matchmakers/delegate_method.rb +101 -0
- data/lib/model/active_record/matchmakers/have_db_column.rb +33 -0
- data/lib/model/active_record/matchmakers/have_db_index.rb +39 -0
- data/lib/model/active_record/matchmakers/have_readonly_attribute.rb +32 -0
- data/lib/model/active_record/matchmakers/have_secure_password.rb +32 -0
- data/lib/model/active_record/matchmakers/serialize.rb +67 -0
- data/lib/model/active_record/matchmakers/validations.rb +169 -0
- data/lib/model/active_record/options_definition.rb +160 -0
- data/lib/shoulda_matchmakers.rb +48 -0
- data/lib/shoulda_matchmakers/version.rb +3 -0
- data/lib/support/command_line_interface.rb +100 -0
- data/lib/support/controller_generator.rb +198 -0
- data/lib/support/indefinite_article.rb +70 -0
- data/lib/support/to_discard/belong_to.rb +94 -0
- data/lib/support/to_discard/have_and_belong_to_many.rb +83 -0
- data/lib/support/to_discard/have_many.rb +96 -0
- data/lib/support/to_discard/have_one.rb +98 -0
- data/lib/support/to_discard/permit_refactor.rb +270 -0
- data/lib/support/to_discard/render_template_new.rb +204 -0
- data/lib/support/to_discard/render_template_reconstruction.rb +188 -0
- data/lib/support/to_discard/use_around_action.rb +20 -0
- data/lib/support/to_discard/use_before_action.rb +20 -0
- data/lib/support/to_discard/validate_absence_of.rb +16 -0
- data/lib/support/to_discard/validate_acceptance_of.rb +16 -0
- data/lib/support/to_discard/validate_confirmation_of.rb +16 -0
- data/lib/support/to_discard/validate_exclusion_of.rb +145 -0
- data/lib/support/to_discard/validate_inclusion_of.rb +94 -0
- data/lib/support/to_discard/validate_length_of.rb +16 -0
- data/lib/support/to_discard/validate_numericality_of.rb +16 -0
- data/lib/support/to_discard/validate_presence_of.rb +16 -0
- data/lib/support/to_discard/validate_uniqueness_of.rb +16 -0
- data/lib/support/to_discard/validation_old.rb +37 -0
- data/lib/support/to_discard/validations.rb +41 -0
- data/lib/support/to_discard/validations_conditional.rb +146 -0
- data/lib/support/trace_debug_lines.txt +319 -0
- data/lib/support/util.rb +15 -0
- data/lib/templates/controller/action_controller/controller_spec_template.haml +146 -0
- data/lib/templates/factory/active_record/factory_template.haml +13 -0
- data/lib/templates/model/active_record/model_spec_template.haml +233 -0
- data/lib/templates/shoulda_matchmakers.rb +112 -0
- metadata +263 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
= "FactoryGirl.define do"
|
2
|
+
= "\n"
|
3
|
+
|
4
|
+
= " factory :#{ @active_record_model_factory_sm_model.app_class_name.demodulize.underscore }, class: #{ @active_record_model_factory_sm_model.app_class_name } do"
|
5
|
+
- factory_attributes = @active_record_model_factory_sm_model.factory_attributes
|
6
|
+
- if factory_attributes.present?
|
7
|
+
= factory_attributes
|
8
|
+
- else
|
9
|
+
= "\n"
|
10
|
+
= " end"
|
11
|
+
|
12
|
+
= "\n"
|
13
|
+
= "end"
|
@@ -0,0 +1,233 @@
|
|
1
|
+
= "RSpec.describe #{ @active_record_model_sm_model.app_class_name }, type: :model, shoulda_matchmakers: true do"
|
2
|
+
|
3
|
+
- belong_to_matcher_tests = @active_record_model_sm_model.association_matcher_tests("belongs_to")
|
4
|
+
- have_one_matcher_tests = @active_record_model_sm_model.association_matcher_tests("has_one")
|
5
|
+
- have_many_matcher_tests = @active_record_model_sm_model.association_matcher_tests("has_many")
|
6
|
+
- have_and_belong_to_many_matcher_tests = @active_record_model_sm_model.association_matcher_tests("has_and_belongs_to_many")
|
7
|
+
|
8
|
+
- if belong_to_matcher_tests.present? || have_one_matcher_tests.present? || have_many_matcher_tests.present? || |
|
9
|
+
have_and_belong_to_many_matcher_tests.present? |
|
10
|
+
= "\n"
|
11
|
+
\# ------------------------------------------------------------------------------------------------
|
12
|
+
\# #### Associations
|
13
|
+
|
14
|
+
- if belong_to_matcher_tests.present?
|
15
|
+
\#
|
16
|
+
\# ##### belongs_to
|
17
|
+
\#
|
18
|
+
= belong_to_matcher_tests
|
19
|
+
= "\n"
|
20
|
+
|
21
|
+
- if have_one_matcher_tests.present?
|
22
|
+
\#
|
23
|
+
\# ##### has_one
|
24
|
+
\#
|
25
|
+
= have_one_matcher_tests
|
26
|
+
= "\n"
|
27
|
+
|
28
|
+
- if have_many_matcher_tests.present?
|
29
|
+
\#
|
30
|
+
\# ##### has_many
|
31
|
+
\#
|
32
|
+
= have_many_matcher_tests
|
33
|
+
= "\n"
|
34
|
+
|
35
|
+
- if have_and_belong_to_many_matcher_tests.present?
|
36
|
+
\#
|
37
|
+
\# ##### has_and_belongs_to_many
|
38
|
+
\#
|
39
|
+
= have_and_belong_to_many_matcher_tests
|
40
|
+
= "\n"
|
41
|
+
|
42
|
+
|
43
|
+
- accept_nested_attributes_for_matcher_tests = @active_record_model_sm_model.accept_nested_attributes_for_matcher_tests
|
44
|
+
- have_readonly_attribute_matcher_tests = @active_record_model_sm_model.have_readonly_attribute_matcher_tests
|
45
|
+
- have_secure_password_matcher_tests = @active_record_model_sm_model.have_secure_password_matcher_tests
|
46
|
+
|
47
|
+
- if accept_nested_attributes_for_matcher_tests.present? || have_readonly_attribute_matcher_tests.present? || |
|
48
|
+
have_secure_password_matcher_tests.present? |
|
49
|
+
= "\n"
|
50
|
+
\# ------------------------------------------------------------------------------------------------
|
51
|
+
\# #### Attributes
|
52
|
+
|
53
|
+
- if accept_nested_attributes_for_matcher_tests.present?
|
54
|
+
\#
|
55
|
+
\# ##### accept_nested_attributes_for
|
56
|
+
\#
|
57
|
+
= accept_nested_attributes_for_matcher_tests
|
58
|
+
= "\n"
|
59
|
+
|
60
|
+
- if have_readonly_attribute_matcher_tests.present?
|
61
|
+
\#
|
62
|
+
\# ##### have_readonly_attribute
|
63
|
+
\#
|
64
|
+
= have_readonly_attribute_matcher_tests
|
65
|
+
= "\n"
|
66
|
+
|
67
|
+
- if have_secure_password_matcher_tests.present?
|
68
|
+
\#
|
69
|
+
\# ##### have_secure_password
|
70
|
+
\#
|
71
|
+
= have_secure_password_matcher_tests
|
72
|
+
= "\n"
|
73
|
+
|
74
|
+
|
75
|
+
- have_db_column_matcher_tests = @active_record_model_sm_model.have_db_column_matcher_tests
|
76
|
+
- have_db_index_matcher_tests = @active_record_model_sm_model.have_db_index_matcher_tests
|
77
|
+
|
78
|
+
- if have_db_column_matcher_tests.present? || have_db_index_matcher_tests.present?
|
79
|
+
= "\n"
|
80
|
+
\# ------------------------------------------------------------------------------------------------
|
81
|
+
\# #### Database
|
82
|
+
|
83
|
+
- if have_db_column_matcher_tests.present?
|
84
|
+
\#
|
85
|
+
\# ##### columns
|
86
|
+
\#
|
87
|
+
= have_db_column_matcher_tests
|
88
|
+
= "\n"
|
89
|
+
|
90
|
+
- if have_db_index_matcher_tests.present?
|
91
|
+
\#
|
92
|
+
\# ##### indexes
|
93
|
+
\#
|
94
|
+
= have_db_index_matcher_tests
|
95
|
+
= "\n"
|
96
|
+
|
97
|
+
|
98
|
+
- if ShouldaMatchmakers.configuration.include_enums
|
99
|
+
- define_enum_for_matcher_tests = @active_record_model_sm_model.define_enum_for_matcher_tests || ""
|
100
|
+
- serialize_matcher_tests = @active_record_model_sm_model.serialize_matcher_tests
|
101
|
+
|
102
|
+
- if define_enum_for_matcher_tests.present? || serialize_matcher_tests.present?
|
103
|
+
= "\n"
|
104
|
+
\# ------------------------------------------------------------------------------------------------
|
105
|
+
\# #### Enums & Serialize
|
106
|
+
|
107
|
+
- if define_enum_for_matcher_tests.present?
|
108
|
+
\#
|
109
|
+
\# ##### enums
|
110
|
+
\#
|
111
|
+
= define_enum_for_matcher_tests
|
112
|
+
= "\n"
|
113
|
+
|
114
|
+
- if serialize_matcher_tests.present?
|
115
|
+
\#
|
116
|
+
\# ##### serialize
|
117
|
+
\#
|
118
|
+
= serialize_matcher_tests
|
119
|
+
= "\n"
|
120
|
+
|
121
|
+
|
122
|
+
- delegate_method_matcher_tests = @active_record_model_sm_model.delegate_method_matcher_tests
|
123
|
+
|
124
|
+
- if delegate_method_matcher_tests.present?
|
125
|
+
= "\n"
|
126
|
+
\# ------------------------------------------------------------------------------------------------
|
127
|
+
\# #### Methods
|
128
|
+
|
129
|
+
- if delegate_method_matcher_tests.present?
|
130
|
+
\#
|
131
|
+
\# ##### delegate_method
|
132
|
+
\#
|
133
|
+
= delegate_method_matcher_tests
|
134
|
+
= "\n"
|
135
|
+
|
136
|
+
|
137
|
+
- allow_value_matcher_tests = @active_record_model_sm_model.allow_value_matcher_tests
|
138
|
+
- validate_absence_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::AbsenceValidator)
|
139
|
+
- validate_acceptance_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::AcceptanceValidator)
|
140
|
+
- validate_confirmation_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::ConfirmationValidator)
|
141
|
+
- validate_exclusion_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::ExclusionValidator)
|
142
|
+
- validate_inclusion_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::InclusionValidator)
|
143
|
+
- validate_length_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::LengthValidator)
|
144
|
+
- validate_numericality_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveModel::Validations::NumericalityValidator)
|
145
|
+
- validate_presence_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveRecord::Validations::PresenceValidator)
|
146
|
+
- validate_uniqueness_of_matcher_tests = @active_record_model_sm_model.validator_matcher_tests(::ActiveRecord::Validations::UniquenessValidator)
|
147
|
+
|
148
|
+
- if allow_value_matcher_tests.present? || validate_absence_of_matcher_tests.present? || |
|
149
|
+
validate_acceptance_of_matcher_tests.present? || validate_confirmation_of_matcher_tests.present? || |
|
150
|
+
validate_exclusion_of_matcher_tests.present? || validate_inclusion_of_matcher_tests.present? || |
|
151
|
+
validate_length_of_matcher_tests.present? || validate_numericality_of_matcher_tests.present? || |
|
152
|
+
validate_presence_of_matcher_tests.present? || validate_uniqueness_of_matcher_tests.present? |
|
153
|
+
= "\n"
|
154
|
+
\# ------------------------------------------------------------------------------------------------
|
155
|
+
\# #### Validations
|
156
|
+
|
157
|
+
- if allow_value_matcher_tests.present?
|
158
|
+
\#
|
159
|
+
\# ##### allow_value
|
160
|
+
\#
|
161
|
+
\# Remove the 'x' from 'xit' once values are entered.
|
162
|
+
\# If your allowed values are only a single value, use: 'is_expected.to allow_value' (singular)
|
163
|
+
= allow_value_matcher_tests
|
164
|
+
= "\n"
|
165
|
+
|
166
|
+
- if validate_absence_of_matcher_tests.present?
|
167
|
+
\#
|
168
|
+
\# ##### validate_absence_of
|
169
|
+
\#
|
170
|
+
= validate_absence_of_matcher_tests
|
171
|
+
= "\n"
|
172
|
+
|
173
|
+
- if validate_acceptance_of_matcher_tests.present?
|
174
|
+
\#
|
175
|
+
\# ##### validate_acceptance_of
|
176
|
+
\#
|
177
|
+
= validate_acceptance_of_matcher_tests
|
178
|
+
= "\n"
|
179
|
+
|
180
|
+
- if validate_confirmation_of_matcher_tests.present?
|
181
|
+
\#
|
182
|
+
\# ##### validate_confirmation_of
|
183
|
+
\#
|
184
|
+
= validate_confirmation_of_matcher_tests
|
185
|
+
= "\n"
|
186
|
+
|
187
|
+
- if validate_exclusion_of_matcher_tests.present?
|
188
|
+
\#
|
189
|
+
\# ##### validate_exclusion_of
|
190
|
+
\#
|
191
|
+
= validate_exclusion_of_matcher_tests
|
192
|
+
= "\n"
|
193
|
+
|
194
|
+
- if validate_inclusion_of_matcher_tests.present?
|
195
|
+
\#
|
196
|
+
\# ##### validate_inclusion_of
|
197
|
+
\#
|
198
|
+
= validate_inclusion_of_matcher_tests
|
199
|
+
= "\n"
|
200
|
+
|
201
|
+
- if validate_length_of_matcher_tests.present?
|
202
|
+
\#
|
203
|
+
\# ##### validate_length_of
|
204
|
+
\#
|
205
|
+
= validate_length_of_matcher_tests
|
206
|
+
= "\n"
|
207
|
+
|
208
|
+
- if validate_numericality_of_matcher_tests.present?
|
209
|
+
\#
|
210
|
+
\# ##### validate_numericality_of
|
211
|
+
\#
|
212
|
+
= validate_numericality_of_matcher_tests
|
213
|
+
= "\n"
|
214
|
+
|
215
|
+
- if validate_presence_of_matcher_tests.present?
|
216
|
+
\#
|
217
|
+
\# ##### validate_presence_of
|
218
|
+
\#
|
219
|
+
= validate_presence_of_matcher_tests
|
220
|
+
= "\n"
|
221
|
+
|
222
|
+
- if validate_uniqueness_of_matcher_tests.present?
|
223
|
+
\#
|
224
|
+
\# ##### validate_uniqueness_of
|
225
|
+
\#
|
226
|
+
\# It is recommended that you review the caveat for the 'validate_uniqueness_of' matcher here:
|
227
|
+
\# https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb
|
228
|
+
\#
|
229
|
+
= validate_uniqueness_of_matcher_tests
|
230
|
+
= "\n"
|
231
|
+
|
232
|
+
|
233
|
+
= "end"
|
@@ -0,0 +1,112 @@
|
|
1
|
+
if defined?(ShouldaMatchmakers) && Rails.env.test?
|
2
|
+
|
3
|
+
ShouldaMatchmakers.configure do |config|
|
4
|
+
|
5
|
+
## MODELS
|
6
|
+
|
7
|
+
# Path for ActiveRecord model generated test files
|
8
|
+
# Default is 'spec/shoulda_matchmakers/models' so as not to overwrite your existing tests
|
9
|
+
#
|
10
|
+
# config.active_record_model_tests_path = 'spec/shoulda_matchmakers/models/active_record'
|
11
|
+
|
12
|
+
# Class names of ActiveRecord models to INCLUDE in the generation of tests.
|
13
|
+
# Configuration value should be an array of String (include namespaces)
|
14
|
+
# Example: %w(Driver License Vehicle::Car Vehicle::Bus)
|
15
|
+
#
|
16
|
+
# By default, ShouldaMatchmakers model test generator includes all ActiveRecord::Base.descendants
|
17
|
+
# If values are set for this option AND the 'config.active_record_class_names_excluded' option,
|
18
|
+
# this option will be applied and the '_excluded' option will be ignored.
|
19
|
+
#
|
20
|
+
# config.active_record_class_names_included = %w()
|
21
|
+
|
22
|
+
# Class names of ActiveRecord models to EXCLUDE from the generation of tests.
|
23
|
+
# Configuration value should be an array of String (include namespaces)
|
24
|
+
# Example: %w(Driver Vehicle::Car)
|
25
|
+
#
|
26
|
+
# By default, ShouldaMatchmakers model test generator excludes no ActiveRecord::Base.descendants
|
27
|
+
# If values are set for this option and the 'config.active_record_class_names_included' option,
|
28
|
+
# the '_included' option will be applied and this option will be ignored.
|
29
|
+
#
|
30
|
+
# config.active_record_class_names_excluded = %w()
|
31
|
+
|
32
|
+
|
33
|
+
## CONTROLLERS
|
34
|
+
|
35
|
+
# Path for ActionController controller generated test files
|
36
|
+
# Default is 'spec/shoulda_matchmakers/controllers' so as not to overwrite your existing tests
|
37
|
+
#
|
38
|
+
# config.action_controller_controller_tests_path = 'spec/shoulda_matchmakers/controllers/action_controller'
|
39
|
+
|
40
|
+
# Names of ActionController controllers to INCLUDE in the generation of tests.
|
41
|
+
# Configuration value should be an array of String (include namespaces)
|
42
|
+
# Example: %w(DriversController LicensesController Vehicle::CarsController Vehicle::BusesController)
|
43
|
+
#
|
44
|
+
# By default, ShouldaMatchmakers controller test generator includes all ActionController::Base.descendants.
|
45
|
+
# If values are set for this option AND the 'config.action_controller_controller_names_excluded' option,
|
46
|
+
# this option will be applied and the '_excluded' option will be ignored.
|
47
|
+
#
|
48
|
+
# config.action_controller_controller_names_included = %w()
|
49
|
+
|
50
|
+
# Names of ActionController controllers to EXCLUDE from the generation of tests.
|
51
|
+
# Configuration value should be an array of String (include namespaces)
|
52
|
+
# Example: %w(DriversController Vehicle::CarsController)
|
53
|
+
#
|
54
|
+
# By default, ShouldaMatchmakers controller test generator excludes no ActionController::Base.descendants.
|
55
|
+
# If values are set for this option AND the 'config.action_controller_controller_names_included' option,
|
56
|
+
# the '_included' option will be applied and this option will be ignored.
|
57
|
+
#
|
58
|
+
# config.action_controller_controller_names_excluded = %w()
|
59
|
+
|
60
|
+
|
61
|
+
## FACTORIES
|
62
|
+
|
63
|
+
# Path for ActiveRecord model generated factory files
|
64
|
+
# Default is 'spec/shoulda_matchmakers/factories' so as not to overwrite your existing factories
|
65
|
+
#
|
66
|
+
# config.active_record_model_factories_path = 'spec/shoulda_matchmakers/factories/active_record'
|
67
|
+
|
68
|
+
# Class names of ActiveRecord models to INCLUDE in the generation of factories.
|
69
|
+
# Configuration value should be an array of String (include namespaces)
|
70
|
+
# Example: %w(Driver License Vehicle::Car Vehicle::Bus)
|
71
|
+
#
|
72
|
+
# By default, the ShouldaMatchmakers factory generator includes all ActiveRecord::Base.descendants.
|
73
|
+
# If values are set for this option AND the 'config.active_record_models_for_factories_excluded'
|
74
|
+
# option, this option will be applied and the '_excluded' option will be ignored.
|
75
|
+
#
|
76
|
+
# config.active_record_model_class_names_for_factories_included = %w()
|
77
|
+
|
78
|
+
# Class names of ActiveRecord models to EXCLUDE from the generation of factories.
|
79
|
+
# Configuration value should be an array of String (include namespaces)
|
80
|
+
# Example: %w(Driver Vehicle::Car)
|
81
|
+
#
|
82
|
+
# By default, the ShouldaMatchmakers factory generator excludes no ActiveRecord::Base.descendants.
|
83
|
+
# If values are set for this option AND the 'config.active_record_models_for_factories_included'
|
84
|
+
# option, the '_included' option will be applied and this option will be ignored.
|
85
|
+
#
|
86
|
+
# config.active_record_model_class_names_for_factories_excluded = %w()
|
87
|
+
|
88
|
+
|
89
|
+
## SHOULDA MATCHMAKERS SETTINGS
|
90
|
+
|
91
|
+
# Enables generation of tests for enums (Rails 4.0+).
|
92
|
+
# If your version is below Rails 4, set this option to false.
|
93
|
+
# Default sets this option to true.
|
94
|
+
#
|
95
|
+
# config.include_enums = true
|
96
|
+
|
97
|
+
# Preferred length of generated code lines
|
98
|
+
# Wherever possible, generated code lines will be broken into multiple lines to keep lines under
|
99
|
+
# your preferred length.
|
100
|
+
# The default value is '100' characters.
|
101
|
+
#
|
102
|
+
# Note: Due to the fact that tests and factories are generated dynamically, lead spacing/tabbing
|
103
|
+
# for each generated line of code is difficult to predict. Therefore, your preferred line length
|
104
|
+
# may, at times, be exceeded as a result of this varying indentation. It may also be exceeded if
|
105
|
+
# there is an inability to break a line further, either due to syntax rules or for the preservation
|
106
|
+
# of readability. If line length is critical, account for this variation in the value you choose.
|
107
|
+
#
|
108
|
+
# config.preferred_generated_code_line_length = 100
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
metadata
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: shoulda_matchmakers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Edwards
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shoulda-matchers
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.1.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.1.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rails
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '4.2'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 4.2.7
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '4.2'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 4.2.7
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: haml
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '4.0'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 4.0.7
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '4.0'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 4.0.7
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: haml-rails
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 0.9.0
|
80
|
+
type: :runtime
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - "~>"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.9.0
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: spin_to_win
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - "~>"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.1.2
|
94
|
+
type: :runtime
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - "~>"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.1.2
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: pg
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - "~>"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0.18'
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.18.4
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.18'
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 0.18.4
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: generator_spec
|
123
|
+
requirement: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "~>"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
type: :development
|
129
|
+
prerelease: false
|
130
|
+
version_requirements: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - "~>"
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: rspec-rails
|
137
|
+
requirement: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - "~>"
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '3.5'
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 3.5.2
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3.5'
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 3.5.2
|
155
|
+
description: |2
|
156
|
+
Shoulda Matchmakers generates regression specs for existing ActiveRecord models and ActionController controllers
|
157
|
+
using Shoulda Matchers. It generates specs for model validations, associations, nested attributes, enum definitions,
|
158
|
+
attribute serialization, database columns and database indexes as well as controller REST routes, and
|
159
|
+
before/after/around actions/filters. It can also generate FactoryGirl factories containing the minimum attributes
|
160
|
+
required for the factory to create a valid object.
|
161
|
+
|
162
|
+
Shoulda Matchmakers is based on the Regressor gem by Erwin Schens.
|
163
|
+
email:
|
164
|
+
- appomatix.software@gmail.com
|
165
|
+
executables: []
|
166
|
+
extensions: []
|
167
|
+
extra_rdoc_files: []
|
168
|
+
files:
|
169
|
+
- MIT-LICENSE
|
170
|
+
- Rakefile
|
171
|
+
- lib/controller/action_controller/action_controller_controller_sm_model.rb
|
172
|
+
- lib/controller/action_controller/action_controller_controller_sm_model_helper.rb
|
173
|
+
- lib/controller/action_controller/matchmakers/callbacks.rb
|
174
|
+
- lib/controller/action_controller/matchmakers/filter_param.rb
|
175
|
+
- lib/controller/action_controller/matchmakers/permit.rb
|
176
|
+
- lib/controller/action_controller/matchmakers/redirect_to.rb
|
177
|
+
- lib/controller/action_controller/matchmakers/render_template.rb
|
178
|
+
- lib/controller/action_controller/matchmakers/render_with_layout.rb
|
179
|
+
- lib/controller/action_controller/matchmakers/rescue_from.rb
|
180
|
+
- lib/controller/action_controller/matchmakers/respond_with.rb
|
181
|
+
- lib/controller/action_controller/matchmakers/route.rb
|
182
|
+
- lib/controller/action_controller/matchmakers/set_flash.rb
|
183
|
+
- lib/controller/action_controller/matchmakers/set_session.rb
|
184
|
+
- lib/controller/action_controller/permitted_params_definition.rb
|
185
|
+
- lib/generators/shoulda_matchmakers/controller_matcher_generator.rb
|
186
|
+
- lib/generators/shoulda_matchmakers/controller_matcher_generator_helper.rb
|
187
|
+
- lib/generators/shoulda_matchmakers/factory_generator.rb
|
188
|
+
- lib/generators/shoulda_matchmakers/install_generator.rb
|
189
|
+
- lib/generators/shoulda_matchmakers/model_matcher_generator.rb
|
190
|
+
- lib/generators/shoulda_matchmakers/model_matcher_generator_helper.rb
|
191
|
+
- lib/model/active_record/active_record_model_sm_model.rb
|
192
|
+
- lib/model/active_record/active_record_model_sm_model_helper.rb
|
193
|
+
- lib/model/active_record/factory_sm_model.rb
|
194
|
+
- lib/model/active_record/factory_sm_model_helper.rb
|
195
|
+
- lib/model/active_record/matchmakers/accept_nested_attributes_for.rb
|
196
|
+
- lib/model/active_record/matchmakers/allow_value.rb
|
197
|
+
- lib/model/active_record/matchmakers/associations.rb
|
198
|
+
- lib/model/active_record/matchmakers/define_enum_for.rb
|
199
|
+
- lib/model/active_record/matchmakers/delegate_method.rb
|
200
|
+
- lib/model/active_record/matchmakers/have_db_column.rb
|
201
|
+
- lib/model/active_record/matchmakers/have_db_index.rb
|
202
|
+
- lib/model/active_record/matchmakers/have_readonly_attribute.rb
|
203
|
+
- lib/model/active_record/matchmakers/have_secure_password.rb
|
204
|
+
- lib/model/active_record/matchmakers/serialize.rb
|
205
|
+
- lib/model/active_record/matchmakers/validations.rb
|
206
|
+
- lib/model/active_record/options_definition.rb
|
207
|
+
- lib/shoulda_matchmakers.rb
|
208
|
+
- lib/shoulda_matchmakers/version.rb
|
209
|
+
- lib/support/command_line_interface.rb
|
210
|
+
- lib/support/controller_generator.rb
|
211
|
+
- lib/support/indefinite_article.rb
|
212
|
+
- lib/support/to_discard/belong_to.rb
|
213
|
+
- lib/support/to_discard/have_and_belong_to_many.rb
|
214
|
+
- lib/support/to_discard/have_many.rb
|
215
|
+
- lib/support/to_discard/have_one.rb
|
216
|
+
- lib/support/to_discard/permit_refactor.rb
|
217
|
+
- lib/support/to_discard/render_template_new.rb
|
218
|
+
- lib/support/to_discard/render_template_reconstruction.rb
|
219
|
+
- lib/support/to_discard/use_around_action.rb
|
220
|
+
- lib/support/to_discard/use_before_action.rb
|
221
|
+
- lib/support/to_discard/validate_absence_of.rb
|
222
|
+
- lib/support/to_discard/validate_acceptance_of.rb
|
223
|
+
- lib/support/to_discard/validate_confirmation_of.rb
|
224
|
+
- lib/support/to_discard/validate_exclusion_of.rb
|
225
|
+
- lib/support/to_discard/validate_inclusion_of.rb
|
226
|
+
- lib/support/to_discard/validate_length_of.rb
|
227
|
+
- lib/support/to_discard/validate_numericality_of.rb
|
228
|
+
- lib/support/to_discard/validate_presence_of.rb
|
229
|
+
- lib/support/to_discard/validate_uniqueness_of.rb
|
230
|
+
- lib/support/to_discard/validation_old.rb
|
231
|
+
- lib/support/to_discard/validations.rb
|
232
|
+
- lib/support/to_discard/validations_conditional.rb
|
233
|
+
- lib/support/trace_debug_lines.txt
|
234
|
+
- lib/support/util.rb
|
235
|
+
- lib/templates/controller/action_controller/controller_spec_template.haml
|
236
|
+
- lib/templates/factory/active_record/factory_template.haml
|
237
|
+
- lib/templates/model/active_record/model_spec_template.haml
|
238
|
+
- lib/templates/shoulda_matchmakers.rb
|
239
|
+
homepage: https://github.com/app-o-matix/shoulda_matchmakers
|
240
|
+
licenses:
|
241
|
+
- MIT
|
242
|
+
metadata: {}
|
243
|
+
post_install_message:
|
244
|
+
rdoc_options: []
|
245
|
+
require_paths:
|
246
|
+
- lib
|
247
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
248
|
+
requirements:
|
249
|
+
- - ">="
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: '0'
|
252
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - ">="
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '0'
|
257
|
+
requirements: []
|
258
|
+
rubyforge_project:
|
259
|
+
rubygems_version: 2.6.8
|
260
|
+
signing_key:
|
261
|
+
specification_version: 4
|
262
|
+
summary: Generates regression specs using Shoulda Matchers
|
263
|
+
test_files: []
|