specstar-remarkable 0.0.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/CHANGELOG +147 -0
- data/LICENSE +20 -0
- data/README +103 -0
- data/lib/remarkable/active_record.rb +14 -0
- data/lib/remarkable/active_record/base.rb +6 -0
- data/lib/remarkable/active_record/matchers/accept_nested_attributes_for_matcher.rb +138 -0
- data/lib/remarkable/active_record/matchers/allow_mass_assignment_of_matcher.rb +74 -0
- data/lib/remarkable/active_record/matchers/association_matcher.rb +284 -0
- data/lib/remarkable/active_record/matchers/have_column_matcher.rb +68 -0
- data/lib/remarkable/active_record/matchers/have_default_scope_matcher.rb +68 -0
- data/lib/remarkable/active_record/matchers/have_index_matcher.rb +73 -0
- data/lib/remarkable/active_record/matchers/have_readonly_attributes_matcher.rb +30 -0
- data/lib/remarkable/active_record/matchers/have_scope_matcher.rb +101 -0
- data/lib/remarkable/active_record/matchers/validate_associated_matcher.rb +100 -0
- data/lib/remarkable/active_record/matchers/validate_uniqueness_of_matcher.rb +233 -0
- data/locale/en.yml +264 -0
- metadata +113 -0
data/locale/en.yml
ADDED
@@ -0,0 +1,264 @@
|
|
1
|
+
en:
|
2
|
+
remarkable:
|
3
|
+
active_record:
|
4
|
+
describe:
|
5
|
+
each: "%{key} is %{value}"
|
6
|
+
prepend: "when "
|
7
|
+
connector: " and "
|
8
|
+
expectations:
|
9
|
+
allow_nil: "%{subject_name} to %{not}allow nil values for %{attribute}"
|
10
|
+
allow_blank: "%{subject_name} to %{not}allow blank values for %{attribute}"
|
11
|
+
optionals:
|
12
|
+
allow_nil:
|
13
|
+
positive: "allowing nil values"
|
14
|
+
negative: "not allowing nil values"
|
15
|
+
allow_blank:
|
16
|
+
positive: "allowing blank values"
|
17
|
+
negative: "not allowing blank values"
|
18
|
+
|
19
|
+
accept_nested_attributes_for:
|
20
|
+
description: "accept nested attributes for %{associations}"
|
21
|
+
expectations:
|
22
|
+
association_exists: "%{subject_name} to have association %{association}, but does not"
|
23
|
+
is_autosave: "%{subject_name} to have association %{association} with autosave true, got false"
|
24
|
+
responds_to_attributes: "%{subject_name} to respond to :%{association}_attributes=, but does not"
|
25
|
+
allows_destroy: "%{subject_name} with allow destroy equals to %{allow_destroy}, got %{actual}"
|
26
|
+
accepts: "%{subject_name} to accept attributes %{attributes} for %{association}, but does not"
|
27
|
+
rejects: "%{subject_name} to reject attributes %{attributes} for %{association}, but does not"
|
28
|
+
optionals:
|
29
|
+
allow_destroy:
|
30
|
+
positive: "allowing destroy"
|
31
|
+
negative: "not allowing destroy"
|
32
|
+
accept:
|
33
|
+
positive: "accepting %{sentence}"
|
34
|
+
reject:
|
35
|
+
positive: "rejecting %{sentence}"
|
36
|
+
|
37
|
+
allow_values_for:
|
38
|
+
description: "allow %{in} as values for %{attributes}"
|
39
|
+
expectations:
|
40
|
+
is_valid: "%{subject_name} to be valid when %{attribute} is set to %{value}"
|
41
|
+
|
42
|
+
allow_mass_assignment_of:
|
43
|
+
description: "allow mass assignment of %{attributes}"
|
44
|
+
expectations:
|
45
|
+
allows: "%{subject_name} to allow mass assignment (%{subject_name} is protecting %{protected_attributes})"
|
46
|
+
is_protected: "%{subject_name} to allow mass assignment of %{attribute} (%{subject_name} is protecting %{attribute})"
|
47
|
+
is_accessible: "%{subject_name} to allow mass assignment of %{attribute} (%{subject_name} has not made %{attribute} accessible)"
|
48
|
+
negative_expectations:
|
49
|
+
allows: "%{subject_name} to allow mass assignment (%{subject_name} made %{accessible_attributes} accessible)"
|
50
|
+
is_protected: "%{subject_name} to allow mass assignment of %{attribute} (%{subject_name} is not protecting %{attribute})"
|
51
|
+
is_accessible: "%{subject_name} to allow mass assignment of %{attribute} (%{subject_name} has made %{attribute} accessible)"
|
52
|
+
|
53
|
+
association:
|
54
|
+
belongs_to: belong to
|
55
|
+
has_many: have many
|
56
|
+
has_and_belongs_to_many: have and belong to many
|
57
|
+
has_one: have one
|
58
|
+
description: "%{macro} %{associations}"
|
59
|
+
expectations:
|
60
|
+
association_exists: "%{subject_name} records %{macro} %{association}, but the association does not exist"
|
61
|
+
macro_matches: "%{subject_name} records %{macro} %{association}, got %{subject_name} records %{actual_macro} %{association}"
|
62
|
+
through_exists: "%{subject_name} records %{macro} %{association} through %{through}, through association does not exist"
|
63
|
+
source_exists: "%{subject_name} records %{macro} %{association} through %{through}, source association does not exist"
|
64
|
+
klass_exists: "%{subject_name} records %{macro} %{association}, but the association class does not exist"
|
65
|
+
join_table_exists: "join table %{join_table} to exist, but does not"
|
66
|
+
foreign_key_exists: "foreign key %{foreign_key} to exist on %{foreign_key_table}, but does not"
|
67
|
+
polymorphic_exists: "%{subject_table} to have %{polymorphic_column} as column, but does not"
|
68
|
+
counter_cache_exists: "%{reflection_table} to have %{counter_cache_column} as column, but does not"
|
69
|
+
options_match: "%{subject_name} records %{macro} %{association} with options %{options}, got %{actual}"
|
70
|
+
optionals:
|
71
|
+
through:
|
72
|
+
positive: "through %{value}"
|
73
|
+
source:
|
74
|
+
positive: "with source %{inspect}"
|
75
|
+
source_type:
|
76
|
+
positive: "with source type %{inspect}"
|
77
|
+
class_name:
|
78
|
+
positive: "with class name %{inspect}"
|
79
|
+
foreign_key:
|
80
|
+
positive: "with foreign key %{inspect}"
|
81
|
+
dependent:
|
82
|
+
positive: "with dependent %{inspect}"
|
83
|
+
join_table:
|
84
|
+
positive: "with join table %{inspect}"
|
85
|
+
uniq:
|
86
|
+
positive: "with unique records"
|
87
|
+
negative: "without unique records"
|
88
|
+
readonly:
|
89
|
+
positive: "with readonly records"
|
90
|
+
negative: "without readonly records"
|
91
|
+
validate:
|
92
|
+
positive: "validating associated records"
|
93
|
+
negative: "not validating associated records"
|
94
|
+
autosave:
|
95
|
+
positive: "autosaving associated records"
|
96
|
+
negative: "not autosaving associated records"
|
97
|
+
as:
|
98
|
+
positive: "through the polymorphic interface %{inspect}"
|
99
|
+
counter_cache:
|
100
|
+
positive: "with counter cache %{inspect}"
|
101
|
+
negative: "without counter cache"
|
102
|
+
select:
|
103
|
+
positive: "selecting %{inspect}"
|
104
|
+
conditions:
|
105
|
+
positive: "with conditions %{inspect}"
|
106
|
+
include:
|
107
|
+
positive: "including %{inspect}"
|
108
|
+
group:
|
109
|
+
positive: "grouping by %{inspect}"
|
110
|
+
having:
|
111
|
+
positive: "having %{inspect}"
|
112
|
+
order:
|
113
|
+
positive: "with order %{inspect}"
|
114
|
+
limit:
|
115
|
+
positive: "with limit %{inspect}"
|
116
|
+
offset:
|
117
|
+
positive: "with offset %{inspect}"
|
118
|
+
|
119
|
+
have_column:
|
120
|
+
description: "have column(s) named %{columns}"
|
121
|
+
expectations:
|
122
|
+
column_exists: "%{subject_name} to have column named %{column}"
|
123
|
+
options_match: "%{subject_name} to have column %{column} with options %{options}, got %{actual}"
|
124
|
+
optionals:
|
125
|
+
type:
|
126
|
+
positive: "with type %{inspect}"
|
127
|
+
null:
|
128
|
+
positive: "allowing null values"
|
129
|
+
negative: "not allowing null values"
|
130
|
+
default:
|
131
|
+
positive: "with default value %{inspect}"
|
132
|
+
negative: "with default value %{inspect}"
|
133
|
+
limit:
|
134
|
+
positive: "with limit %{inspect}"
|
135
|
+
|
136
|
+
have_default_scope:
|
137
|
+
description: "have a default scope with %{options}"
|
138
|
+
expectations:
|
139
|
+
options_match: "default scope with %{options}, got %{actual}"
|
140
|
+
|
141
|
+
have_index:
|
142
|
+
description: "have index for column(s) %{columns}"
|
143
|
+
expectations:
|
144
|
+
index_exists: "index %{column} to exist on table %{table_name}"
|
145
|
+
is_unique: "index on %{column} with unique equals to %{unique}, got %{actual}"
|
146
|
+
optionals:
|
147
|
+
unique:
|
148
|
+
positive: "with unique values"
|
149
|
+
negative: "with non unique values"
|
150
|
+
table_name:
|
151
|
+
positive: "on table %{value}"
|
152
|
+
|
153
|
+
have_readonly_attributes:
|
154
|
+
description: "make %{attributes} read-only"
|
155
|
+
expectations:
|
156
|
+
is_readonly: "%{subject_name} to make %{attribute} read-only, got %{actual}"
|
157
|
+
|
158
|
+
have_scope:
|
159
|
+
description: "have to scope itself to %{options} when %{scope_name} is called"
|
160
|
+
expectations:
|
161
|
+
is_scope: "%{scope_name} when called on %{subject_name} return an instance of ActiveRecord::NamedScope::Scope"
|
162
|
+
options_match: "%{scope_name} when called on %{subject_name} scope to %{options}, got %{actual}"
|
163
|
+
optionals:
|
164
|
+
with:
|
165
|
+
positive: "with %{inspect} as argument"
|
166
|
+
|
167
|
+
validate_acceptance_of:
|
168
|
+
description: "require %{attributes} to be accepted"
|
169
|
+
expectations:
|
170
|
+
requires_acceptance: "%{subject_name} to be invalid if %{attribute} is not accepted"
|
171
|
+
accept_is_valid: "%{subject_name} to be valid when %{attribute} is accepted with value %{accept}"
|
172
|
+
optionals:
|
173
|
+
accept:
|
174
|
+
positive: "with value %{inspect}"
|
175
|
+
|
176
|
+
validate_associated:
|
177
|
+
description: "require associated %{associations} to be valid"
|
178
|
+
expectations:
|
179
|
+
is_valid: "%{subject_name} to be invalid when %{association} is invalid"
|
180
|
+
|
181
|
+
validate_confirmation_of:
|
182
|
+
description: "require %{attributes} to be confirmed"
|
183
|
+
expectations:
|
184
|
+
responds_to_confirmation: "%{subject_name} instance responds to %{attribute}_confirmation"
|
185
|
+
confirms: "%{subject_name} to be valid only when %{attribute} is confirmed"
|
186
|
+
|
187
|
+
validate_exclusion_of:
|
188
|
+
description: "ensure exclusion of %{attributes} in %{in}"
|
189
|
+
expectations:
|
190
|
+
is_valid: "%{subject_name} to be valid when %{attribute} is set to %{value}"
|
191
|
+
is_invalid: "%{subject_name} to be invalid when %{attribute} is set to %{value}"
|
192
|
+
|
193
|
+
validate_inclusion_of:
|
194
|
+
description: "ensure inclusion of %{attributes} in %{in}"
|
195
|
+
expectations:
|
196
|
+
is_valid: "%{subject_name} to be valid when %{attribute} is set to %{value}"
|
197
|
+
is_invalid: "%{subject_name} to be invalid when %{attribute} is set to %{value}"
|
198
|
+
|
199
|
+
validate_length_of:
|
200
|
+
description: "ensure length of %{attributes}"
|
201
|
+
expectations:
|
202
|
+
less_than_min_length: "%{subject_name} to be invalid when %{attribute} length is less than %{minimum} characters"
|
203
|
+
exactly_min_length: "%{subject_name} to be valid when %{attribute} length is %{minimum} characters"
|
204
|
+
more_than_max_length: "%{subject_name} to be invalid when %{attribute} length is more than %{maximum} characters"
|
205
|
+
exactly_max_length: "%{subject_name} to be valid when %{attribute} length is %{maximum} characters"
|
206
|
+
optionals:
|
207
|
+
within:
|
208
|
+
positive: "is within %{inspect} characters"
|
209
|
+
maximum:
|
210
|
+
positive: "is maximum %{inspect} characters"
|
211
|
+
minimum:
|
212
|
+
positive: "is minimum %{inspect} characters"
|
213
|
+
is:
|
214
|
+
positive: "is equal to %{inspect} characters"
|
215
|
+
with_kind_of:
|
216
|
+
positive: "with kind of %{value}"
|
217
|
+
|
218
|
+
validate_numericality_of:
|
219
|
+
description: "ensure numericality of %{attributes}"
|
220
|
+
expectations:
|
221
|
+
only_numeric_values: "%{subject_name} to allow only numeric values for %{attribute}"
|
222
|
+
only_integer: "%{subject_name} to %{not}allow only integer values for %{attribute}"
|
223
|
+
only_even: "%{subject_name} to allow only even values for %{attribute}"
|
224
|
+
only_odd: "%{subject_name} to allow only odd values for %{attribute}"
|
225
|
+
equals_to: "%{subject_name} to be valid only when %{attribute} is equal to %{count}"
|
226
|
+
more_than_maximum: "%{subject_name} to be invalid when %{attribute} is greater than %{count}"
|
227
|
+
less_than_minimum: "%{subject_name} to be invalid when %{attribute} is less than %{count}"
|
228
|
+
optionals:
|
229
|
+
only_integer:
|
230
|
+
positive: "allowing only integer values"
|
231
|
+
odd:
|
232
|
+
positive: "allowing only odd values"
|
233
|
+
even:
|
234
|
+
positive: "allowing only even values"
|
235
|
+
equal_to:
|
236
|
+
positive: "is equal to %{inspect}"
|
237
|
+
less_than:
|
238
|
+
positive: "is less than %{inspect}"
|
239
|
+
greater_than:
|
240
|
+
positive: "is greater than %{inspect}"
|
241
|
+
less_than_or_equal_to:
|
242
|
+
positive: "is less than or equal to %{inspect}"
|
243
|
+
greater_than_or_equal_to:
|
244
|
+
positive: "is greater than or equal to %{inspect}"
|
245
|
+
|
246
|
+
validate_presence_of:
|
247
|
+
description: "require %{attributes} to be set"
|
248
|
+
expectations:
|
249
|
+
allow_nil: "%{subject_name} to require %{attribute} to be set"
|
250
|
+
|
251
|
+
validate_uniqueness_of:
|
252
|
+
description: "require unique values for %{attributes}"
|
253
|
+
expectations:
|
254
|
+
responds_to_scope: "%{subject_name} instance responds to %{method}"
|
255
|
+
is_unique: "%{subject_name} to require unique values for %{attribute}"
|
256
|
+
case_sensitive: "%{subject_name} to %{not}be case sensitive on %{attribute} validation"
|
257
|
+
valid_with_new_scope: "%{subject_name} to be valid when %{attribute} scope (%{method}) change"
|
258
|
+
optionals:
|
259
|
+
scope:
|
260
|
+
positive: "scoped to %{sentence}"
|
261
|
+
case_sensitive:
|
262
|
+
positive: "case sensitive"
|
263
|
+
negative: "case insensitive"
|
264
|
+
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: specstar-remarkable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ho-Sheng Hsiao
|
8
|
+
- Carlos Brando
|
9
|
+
- José Valim
|
10
|
+
- Diego Carrion
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2012-03-04 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rspec
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.0.0.alpha11
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.0.alpha11
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: remarkable
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ~>
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 4.0.0.alpha4
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 4.0.0.alpha4
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: remarkable_activemodel
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ~>
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 4.0.0.alpha4
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 4.0.0.alpha4
|
58
|
+
description: 'Remarkable ActiveRecord: collection of matchers and macros with I18n
|
59
|
+
for ActiveRecord'
|
60
|
+
email:
|
61
|
+
- hosh@sparkfly.com
|
62
|
+
- eduardobrando@gmail.com
|
63
|
+
- jose.valim@gmail.com
|
64
|
+
- dc.rec1@gmail.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files:
|
68
|
+
- CHANGELOG
|
69
|
+
- LICENSE
|
70
|
+
- README
|
71
|
+
files:
|
72
|
+
- CHANGELOG
|
73
|
+
- LICENSE
|
74
|
+
- README
|
75
|
+
- lib/remarkable/active_record.rb
|
76
|
+
- lib/remarkable/active_record/base.rb
|
77
|
+
- lib/remarkable/active_record/matchers/accept_nested_attributes_for_matcher.rb
|
78
|
+
- lib/remarkable/active_record/matchers/allow_mass_assignment_of_matcher.rb
|
79
|
+
- lib/remarkable/active_record/matchers/association_matcher.rb
|
80
|
+
- lib/remarkable/active_record/matchers/have_column_matcher.rb
|
81
|
+
- lib/remarkable/active_record/matchers/have_default_scope_matcher.rb
|
82
|
+
- lib/remarkable/active_record/matchers/have_index_matcher.rb
|
83
|
+
- lib/remarkable/active_record/matchers/have_readonly_attributes_matcher.rb
|
84
|
+
- lib/remarkable/active_record/matchers/have_scope_matcher.rb
|
85
|
+
- lib/remarkable/active_record/matchers/validate_associated_matcher.rb
|
86
|
+
- lib/remarkable/active_record/matchers/validate_uniqueness_of_matcher.rb
|
87
|
+
- locale/en.yml
|
88
|
+
homepage: http://github.com/carlosbrando/remarkable
|
89
|
+
licenses: []
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options:
|
93
|
+
- --charset=UTF-8
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>'
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.3.1
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project: remarkable
|
108
|
+
rubygems_version: 2.1.4
|
109
|
+
signing_key:
|
110
|
+
specification_version: 3
|
111
|
+
summary: 'Remarkable ActiveRecord: collection of matchers and macros with I18n for
|
112
|
+
ActiveRecord'
|
113
|
+
test_files: []
|