active-fixtures 0.0.1 → 0.0.2

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: 54bd0172edecb818492c68d1ee90d4c6c3fc855c
4
- data.tar.gz: ba2b97ec7dc4c14a95765dfd98dc56e0e85cb017
3
+ metadata.gz: 0b69301ab1a203ec833323814e43e8ee21bc8c37
4
+ data.tar.gz: b635e04c2a4b1c96aeb1128d3271127f1fdce4ab
5
5
  SHA512:
6
- metadata.gz: c41606271c058aa0e688c1aba385054eac7e68609d44ef8f8ebddba15caaf6755a7b1b57b33c848ff9c78a1b7f2938c4521f5560d0677a33387b91b49dfb90f3
7
- data.tar.gz: 735065ee98e5e34df977c6a607067ea0465b611d89850534195ffdc94f15260cf63b70cca75ede71996d7b1ab85141d893baf5417de1a738e6c68cbdf619884c
6
+ metadata.gz: c38ed1954911e634d7123c4d6c267d33102666ebe17f9a152297541138c23403f6f2100712ba944689c62d75c29141f1aab1d37c4179405a1d1543df54e6023b
7
+ data.tar.gz: ddee513aea13b074d52b7c1f0365327060cb34c869054308c626c753b9dcd477a0bc31cc315e04a8867f2b4687a545d9e62adf04f7e388d007f4692ead7d8f12
data/README.md CHANGED
@@ -33,7 +33,7 @@ which entities he understand, how he affects to such entities.
33
33
  In general case, tests in isolation are at least useless, at max - hurtful.
34
34
  Lets write acceptance tests instead!
35
35
 
36
- ## requirements
36
+ ## Requirements
37
37
  Currently works with Poltergeist and PostgreSQL.
38
38
 
39
39
  ## Getting started
@@ -41,7 +41,7 @@ Currently works with Poltergeist and PostgreSQL.
41
41
  Add to your Gemfile:
42
42
 
43
43
  ```ruby
44
- gem 'ruby-features', group: :test
44
+ gem 'active-fixtures', group: :test
45
45
  ```
46
46
 
47
47
  Add to your rspec helper:
@@ -1,4 +1,5 @@
1
1
  require 'active-fixtures/version'
2
+ require 'active_attr'
2
3
 
3
4
  module ActiveFixtures
4
5
  autoload :Resource, 'active-fixtures/resource'
@@ -8,6 +9,8 @@ module ActiveFixtures
8
9
  autoload :State, 'active-fixtures/state'
9
10
  autoload :StateDumper, 'active-fixtures/state_dumper'
10
11
 
12
+ class PrepareStateError < StandardError; end
13
+
11
14
  mattr_accessor :state_builders
12
15
  self.state_builders = {}
13
16
 
@@ -25,6 +28,8 @@ module ActiveFixtures
25
28
  end
26
29
 
27
30
  def prepare!(name)
31
+ raise PrepareStateError.new("Undefined active fixture: #{name.inspect}") unless state_builders.key?(name)
32
+
28
33
  self.current_state = State.new(name)
29
34
  current_state.prepare!(state_builders[name])
30
35
  end
@@ -1,7 +1,7 @@
1
1
  module ActiveFixtures
2
2
  module StateDumper
3
3
  FIXTURES_PATH = Rails.root.join('spec/fixtures/active').freeze
4
- DB_NAME = ApplicationRecord.connection_config[:database].freeze
4
+ DB_NAME = Rails.configuration.database_configuration[Rails.env]['database'].freeze
5
5
  CLEAN_STATE_NAME = :__clean
6
6
 
7
7
  class << self
@@ -1,3 +1,3 @@
1
1
  module ActiveFixtures
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-05 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2016-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: active_attr
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description: active-fixtures provides the way how to populate the server state (DB,
14
42
  sessions) as an application user but not as programmer.
15
43
  email: private.tokarenko.sergey@gmail.com