active-fixtures 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b69301ab1a203ec833323814e43e8ee21bc8c37
4
- data.tar.gz: b635e04c2a4b1c96aeb1128d3271127f1fdce4ab
3
+ metadata.gz: 54ad16c565dbbcd5ef8a693818e5d7ddf09d24b7
4
+ data.tar.gz: 724dda464a6113e9e43a150ed8541c1484462127
5
5
  SHA512:
6
- metadata.gz: c38ed1954911e634d7123c4d6c267d33102666ebe17f9a152297541138c23403f6f2100712ba944689c62d75c29141f1aab1d37c4179405a1d1543df54e6023b
7
- data.tar.gz: ddee513aea13b074d52b7c1f0365327060cb34c869054308c626c753b9dcd477a0bc31cc315e04a8867f2b4687a545d9e62adf04f7e388d007f4692ead7d8f12
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
- gem 'active-fixtures', group: :test
44
+ group :development, :test do
45
+ gem 'active-fixtures'
46
+ end
45
47
  ```
46
48
 
47
- Add to your rspec helper:
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
@@ -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
@@ -0,0 +1,7 @@
1
+ module ActiveFixtures
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ Dir[File.join(File.dirname(__FILE__),'../tasks/*.rake')].each { |f| load f }
5
+ end
6
+ end
7
+ end
@@ -13,7 +13,7 @@ RSpec.configure do |config|
13
13
  end
14
14
 
15
15
  config.after(:suite) do
16
- ActiveFixtures.cleanup!
16
+ ActiveFixtures.load_clean!
17
17
  end
18
18
 
19
19
  end
@@ -12,7 +12,7 @@ module ActiveFixtures
12
12
  if StateDumper.exists?(name)
13
13
  entities.merge!(StateDumper.load(name))
14
14
  else
15
- StateDumper.load_clean
15
+ StateDumper.load_clean!
16
16
 
17
17
  clean_session = Session.new
18
18
  write_entity(clean_session.name, clean_session)
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module ActiveFixtures
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -0,0 +1,6 @@
1
+ namespace :active_fixtures do
2
+ desc 'Clean the fixtures cache'
3
+ task :clean do
4
+ ActiveFixtures.cleanup!
5
+ end
6
+ end
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.2
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: 2016-12-16 00:00:00.000000000 Z
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