active_mocker 1.7 → 1.7.1rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -23
- data/README.md +2 -2
- data/lib/active_mocker/active_record/relationships.rb +0 -1
- data/lib/active_mocker/version.rb +1 -1
- metadata +20 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27a581cdb90182c0e21fcb680a43e42ebe573a9c
|
4
|
+
data.tar.gz: 31b9e9a16588f87d64fa267542a5434dd752fd27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed95a5fa4681cb5f2187693f4b95ed02e86867bf2bfe3e9f3684713aec0a22ae5fa9721373c9acb225b7d64d4378fa79859974299403cad0c957a6e55e3c331f
|
7
|
+
data.tar.gz: 4a951442f8a0fb1b3c0a1c505687af5f97163ae877039cf5a3f1c2e86de731b3d321af3dea969d5e347c220f71ee97cf97cd016ff896e093da308478ce6cd1f6
|
data/CHANGELOG.md
CHANGED
@@ -1,34 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## 1.
|
4
|
+
## 1.7.1rc - 2014-10-19
|
5
5
|
|
6
6
|
### Enhancement
|
7
|
-
- Now
|
8
|
-
- Check added to see if mock was created with same running gem version of ActiveMocker. If they are not the same it will raise an error informing you to run `rake active_mocker:build`.
|
9
|
-
- belong_to and has_one relationships when assigned will in most cases assign it's self to the corresponding has_many or like association. See `test_rails_4_app/spec/active_record_compatible_api.rb` for supported detail of supported ActiveRecord features.
|
10
|
-
|
11
|
-
### Removed
|
12
|
-
- `ActiveMocker::Mock::Config.experimental` flag has been removed, these are now on by default.
|
13
|
-
|
14
|
-
## Added
|
15
|
-
- Class method `table_name`.
|
16
|
-
|
17
|
-
## 1.7.beta3 - 2014-09-25
|
7
|
+
- Now works with Rails versions: 4.0, 4.1, 4.2beta2.
|
18
8
|
|
19
9
|
### Fix
|
20
|
-
-
|
21
|
-
|
22
|
-
## 1.7.beta2 - 2014-09-18
|
23
|
-
|
24
|
-
### Fix
|
25
|
-
- Bug where creating record with an id could cause a duplicate id error.
|
26
|
-
- Issue whenever an ActiveRecord Model has no schema behind it.
|
27
|
-
- Issue assigning association would fail, added guard to @associations to only read and write symbols.
|
10
|
+
- Issue when a relation had a scope defined by proc it would fail.
|
28
11
|
|
29
|
-
## 1.7
|
12
|
+
## 1.7 - 2014-10-14
|
30
13
|
|
31
14
|
### Enhancement
|
15
|
+
- Now will regenerate mock after `rake db:rollback`.
|
16
|
+
- Check added to see if mock was created with same running gem version of ActiveMocker. If they are not the same it will raise an error informing you to run `rake active_mocker:build`.
|
17
|
+
- belong_to and has_one relationships when assigned will in most cases assign it's self to the corresponding has_many or like association. See `test_rails_4_app/spec/active_record_compatible_api.rb` for supported detail of supported ActiveRecord features.
|
32
18
|
- A class that Inherits a model now has the table of the parent.
|
33
19
|
- Use this option if you need to modify where the mock generation hooks into. `ActiveMocker::Config.model_base_classes = %w[ ActiveRecord::Base ]`
|
34
20
|
- When running `rake active_mocker:build` it will display the number of mocks that failed.
|
@@ -37,16 +23,22 @@ All notable changes to this project will be documented in this file.
|
|
37
23
|
- Will create own log file `log/active_mocker.log` it will be cleared on each generation.
|
38
24
|
- Attributes, associations, and scopes will now inherit from their parent class.
|
39
25
|
|
40
|
-
###Removed
|
26
|
+
### Removed
|
27
|
+
- `ActiveMocker::Mock::Config.experimental` flag has been removed, these are now on by default.
|
41
28
|
- Remove deprecated option `ActiveMocker.mock`
|
42
29
|
- Remove Experimental feature reload
|
43
30
|
- Remove experimental flag for set foreign_key on collection for has_many, belongs_to, and has_one.
|
44
31
|
|
45
|
-
|
32
|
+
## Added
|
33
|
+
- Class method `table_name`.
|
46
34
|
- Initialization of an abstract class will raise an error.
|
47
35
|
- `record._create_caller_locations` for debugging obj’s creation location.
|
48
36
|
|
49
37
|
### Fix
|
38
|
+
- Last beta introduced a bug where after assigning some associations they could not be read. Solution was to never access @associations directly inside mock.
|
39
|
+
- Bug where creating record with an id could cause a duplicate id error.
|
40
|
+
- Issue whenever an ActiveRecord Model has no schema behind it.
|
41
|
+
- Issue assigning association would fail, added guard to @associations to only read and write symbols.
|
50
42
|
- Issue where using table names as the model file would replace a parent class with a child class that had the same table.
|
51
43
|
|
52
44
|
## 1.6.3 - 2014-08-14
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Dependency Status](https://gemnasium.com/zeisler/active_mocker.svg)](https://gemnasium.com/zeisler/active_mocker)
|
6
6
|
[![Gitter chat](https://badges.gitter.im/zeisler/active_mocker.png)](https://gitter.im/zeisler/active_mocker)
|
7
7
|
|
8
|
-
ActiveMocker creates mocks classes from ActiveRecord models. Allowing your test suite to run very fast by not loading Rails
|
8
|
+
ActiveMocker creates mocks classes from ActiveRecord models. Allowing your test suite to run very fast by not loading Rails a database. It parses the schema.rb and the defined methods on a model then generates a ruby file that can be included within a test. The mock file can be run by themselves and come with a partial implementation of ActiveRecord. Attributes and associations can be used just the same as in ActiveRecord. Methods will have the correct arguments but raise an NotImplementedError when called. Mocks are regenerated when the schema is modified so your mocks will not go stale; preventing the case where your units tests pass but production code fails.
|
9
9
|
|
10
10
|
Examples from a real apps
|
11
11
|
|
@@ -63,7 +63,7 @@ Or install it yourself as:
|
|
63
63
|
$ gem install active_mocker
|
64
64
|
|
65
65
|
## Dependencies
|
66
|
-
* Tested with Rails 4.1
|
66
|
+
* Tested with Rails 4.0, 4.1, 4.2beta2
|
67
67
|
* Requires Ruby MRI >= 2.1.
|
68
68
|
|
69
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_mocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.7.1rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '4.
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '4.
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: virtus
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '1.3'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rails
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '4.1'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '4.1'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: rspec-rails
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,51 +212,37 @@ dependencies:
|
|
226
212
|
requirements:
|
227
213
|
- - "~>"
|
228
214
|
- !ruby/object:Gem::Version
|
229
|
-
version: '2'
|
215
|
+
version: '2.0'
|
230
216
|
type: :development
|
231
217
|
prerelease: false
|
232
218
|
version_requirements: !ruby/object:Gem::Requirement
|
233
219
|
requirements:
|
234
220
|
- - "~>"
|
235
221
|
- !ruby/object:Gem::Version
|
236
|
-
version: '2'
|
222
|
+
version: '2.0'
|
237
223
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
224
|
+
name: appraisal
|
239
225
|
requirement: !ruby/object:Gem::Requirement
|
240
226
|
requirements:
|
241
227
|
- - "~>"
|
242
228
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
244
|
-
type: :development
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - "~>"
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: '0.0'
|
251
|
-
- !ruby/object:Gem::Dependency
|
252
|
-
name: ruby-debug-ide
|
253
|
-
requirement: !ruby/object:Gem::Requirement
|
254
|
-
requirements:
|
255
|
-
- - "~>"
|
256
|
-
- !ruby/object:Gem::Version
|
257
|
-
version: '0.4'
|
229
|
+
version: '1.0'
|
258
230
|
type: :development
|
259
231
|
prerelease: false
|
260
232
|
version_requirements: !ruby/object:Gem::Requirement
|
261
233
|
requirements:
|
262
234
|
- - "~>"
|
263
235
|
- !ruby/object:Gem::Version
|
264
|
-
version: '0
|
236
|
+
version: '1.0'
|
265
237
|
description: ActiveMocker creates mocks classes from ActiveRecord models. Allowing
|
266
|
-
your test suite to run very fast by not loading Rails or
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
238
|
+
your test suite to run very fast by not loading Rails or a database. It parses the
|
239
|
+
schema.rb and the defined methods on a model then generates a ruby file that can
|
240
|
+
be included within a test. The mock file can be run by themselves and come with
|
241
|
+
a partial implementation of ActiveRecord. Attributes and associations can be used
|
242
|
+
just the same as in ActiveRecord. Methods will have the correct arguments but raise
|
243
|
+
an NotImplementedError when called. Mocks are regenerated when the schema is modified
|
244
|
+
so your mocks will not go stale; preventing the case where your units tests pass
|
245
|
+
but production code fails.
|
274
246
|
email:
|
275
247
|
- dustin@zive.me
|
276
248
|
executables: []
|
@@ -342,14 +314,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
342
314
|
version: 2.1.0
|
343
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
344
316
|
requirements:
|
345
|
-
- - "
|
317
|
+
- - ">"
|
346
318
|
- !ruby/object:Gem::Version
|
347
|
-
version:
|
319
|
+
version: 1.3.1
|
348
320
|
requirements: []
|
349
321
|
rubyforge_project:
|
350
322
|
rubygems_version: 2.2.2
|
351
323
|
signing_key:
|
352
324
|
specification_version: 4
|
353
325
|
summary: Creates mocks from Active Record models. Allows your test suite to run very
|
354
|
-
fast by not loading Rails or
|
326
|
+
fast by not loading Rails or a database.
|
355
327
|
test_files: []
|