active-fixtures 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +17 -3
- data/lib/active-fixtures.rb +5 -0
- data/lib/active-fixtures/railtie.rb +7 -0
- data/lib/active-fixtures/rspec.rb +1 -1
- data/lib/active-fixtures/state.rb +1 -1
- data/lib/active-fixtures/state_dumper.rb +1 -2
- data/lib/active-fixtures/version.rb +1 -1
- data/lib/tasks/active_fixtures.rake +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ad16c565dbbcd5ef8a693818e5d7ddf09d24b7
|
4
|
+
data.tar.gz: 724dda464a6113e9e43a150ed8541c1484462127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5148dc1008bd4098924d0f53cf788c55abb28ce63a60c77180edc4e3ec63a783508cb505375efbaa4e633cbbfff5fc81adceecb75a22c2ccf89a6b88350b1f0
|
7
|
+
data.tar.gz: 4cfa03063c2a45f3e6ded18e34d4f1aac595a76fd9d4f2eb3fabdc337e0b74e0878b700d9a7e6c479f03ddf5fe2ff378260991a47a5a13521ede2bd63bcfc96a
|
data/README.md
CHANGED
@@ -38,17 +38,24 @@ Currently works with Poltergeist and PostgreSQL.
|
|
38
38
|
|
39
39
|
## Getting started
|
40
40
|
|
41
|
-
Add to your Gemfile
|
41
|
+
Add to your `Gemfile`:
|
42
42
|
|
43
43
|
```ruby
|
44
|
-
|
44
|
+
group :development, :test do
|
45
|
+
gem 'active-fixtures'
|
46
|
+
end
|
45
47
|
```
|
46
48
|
|
47
|
-
Add to your
|
49
|
+
Add to your `rails_helper.rb`:
|
48
50
|
```ruby
|
49
51
|
require 'active-fixtures/rspec'
|
50
52
|
```
|
51
53
|
|
54
|
+
Add to your `.gitignore`:
|
55
|
+
```
|
56
|
+
spec/fixtures/active
|
57
|
+
```
|
58
|
+
|
52
59
|
Remove Database Cleaners from your project, ActiveFixtures will take care about database cleanup in additional.
|
53
60
|
|
54
61
|
## Usage
|
@@ -171,5 +178,12 @@ ActiveFixtures work fairly, but effectively.
|
|
171
178
|
Fixture will be populated on the first it's usage, by genuine application's user actions.
|
172
179
|
For the next example it will be loaded from cache - no sense to to the same work again.
|
173
180
|
|
181
|
+
In case when you affecting the fixture creation process
|
182
|
+
(making changes in fixtures, related application functionality, DB schema etc),
|
183
|
+
you need to clean the fixtures cache manually before the tests run:
|
184
|
+
```console
|
185
|
+
$ rake active_fixtures:clean
|
186
|
+
```
|
187
|
+
|
174
188
|
## License
|
175
189
|
MIT License. Copyright (c) 2016 Sergey Tokarenko
|
data/lib/active-fixtures.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active-fixtures/version'
|
2
|
+
require 'active-fixtures/railtie'
|
2
3
|
require 'active_attr'
|
3
4
|
|
4
5
|
module ActiveFixtures
|
@@ -23,6 +24,10 @@ module ActiveFixtures
|
|
23
24
|
StateDumper.init!
|
24
25
|
end
|
25
26
|
|
27
|
+
def load_clean!
|
28
|
+
StateDumper.load_clean!
|
29
|
+
end
|
30
|
+
|
26
31
|
def cleanup!
|
27
32
|
StateDumper.cleanup!
|
28
33
|
end
|
@@ -11,7 +11,6 @@ module ActiveFixtures
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def cleanup!
|
14
|
-
load_clean
|
15
14
|
FileUtils.rm_rf(FIXTURES_PATH) if File.exist?(FIXTURES_PATH)
|
16
15
|
end
|
17
16
|
|
@@ -19,7 +18,7 @@ module ActiveFixtures
|
|
19
18
|
File.exists?(dump_db_file(state_name))
|
20
19
|
end
|
21
20
|
|
22
|
-
def load_clean
|
21
|
+
def load_clean!
|
23
22
|
load_db(CLEAN_STATE_NAME)
|
24
23
|
end
|
25
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fixtures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Tokarenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- LICENSE
|
49
49
|
- README.md
|
50
50
|
- lib/active-fixtures.rb
|
51
|
+
- lib/active-fixtures/railtie.rb
|
51
52
|
- lib/active-fixtures/resource.rb
|
52
53
|
- lib/active-fixtures/rspec.rb
|
53
54
|
- lib/active-fixtures/session.rb
|
@@ -55,6 +56,7 @@ files:
|
|
55
56
|
- lib/active-fixtures/state_builder.rb
|
56
57
|
- lib/active-fixtures/state_dumper.rb
|
57
58
|
- lib/active-fixtures/version.rb
|
59
|
+
- lib/tasks/active_fixtures.rake
|
58
60
|
homepage: https://github.com/Anadea/active-fixtures
|
59
61
|
licenses:
|
60
62
|
- MIT
|