postspec 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postspec/config.rb +6 -3
- data/lib/postspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba916d9dadf392677f5d57fa0ddbdfab2458a122c4c6c286a1be996602db70c8
|
4
|
+
data.tar.gz: cff38fe2468820458869459422acd2a40f066c5e2f7a070c0c9b481e13c9612d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02a5ccb6c9451c24d1ad2f4b7c8cc5a1fd46b9aecbe1acfbf3ccd3eb47cd59b0be707fa522cbe88d86299e1312c6a7a3f03aaaa7f69506aed8aef82f5be0eb37
|
7
|
+
data.tar.gz: 5a0c49a71f4a9b007de038e49f490639cfc16b3a120596185059b0e4ad823cb744054848130f99ddfe5946ed58d4352454503f992d1b900a0066c3f86d02169a
|
data/lib/postspec/config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Used to initialize postspec from spec/spec_helper.rb or spec/postspec_helper.rb
|
2
2
|
#
|
3
3
|
module Postspec
|
4
|
-
Config = Struct.new(:database, :mode, :reflections, :anchors, :fail_fast, :ignore)
|
4
|
+
Config = Struct.new(:database, :mode, :reflections, :anchors, :fail_fast, :ignore, :cache)
|
5
5
|
|
6
6
|
@database = nil
|
7
7
|
@mode = nil
|
@@ -9,6 +9,7 @@ module Postspec
|
|
9
9
|
@anchors = nil
|
10
10
|
@fail_fast = nil
|
11
11
|
@ignore = nil
|
12
|
+
@cache = nil
|
12
13
|
|
13
14
|
DEFAULT_MODE = :empty
|
14
15
|
DEFAULT_FAIL_FAST = true
|
@@ -20,9 +21,10 @@ module Postspec
|
|
20
21
|
def self.anchors() @anchors end
|
21
22
|
def self.fail_fast() @fail_fast end
|
22
23
|
def self.ignore() @ignore end
|
24
|
+
def self.cache() @cache end
|
23
25
|
|
24
26
|
def self.configure(&block)
|
25
|
-
config = Config.new(@database, DEFAULT_MODE, nil, nil, DEFAULT_FAIL_FAST, DEFAULT_IGNORE)
|
27
|
+
config = Config.new(@database, DEFAULT_MODE, nil, nil, DEFAULT_FAIL_FAST, DEFAULT_IGNORE, nil)
|
26
28
|
yield(config)
|
27
29
|
@database = config.database
|
28
30
|
@mode = config.mode || DEFAULT_MODE
|
@@ -30,6 +32,7 @@ module Postspec
|
|
30
32
|
@anchors = config.anchors
|
31
33
|
@fail_fast = config.fail_fast || DEFAULT_FAIL_FAST
|
32
34
|
@ignore = config.ignore || DEFAULT_IGNORE # FIXME: Why not rely on Config defaults?
|
35
|
+
@cache = config.cache
|
33
36
|
self
|
34
37
|
end
|
35
38
|
|
@@ -37,7 +40,7 @@ module Postspec
|
|
37
40
|
!@database.nil? or raise Error, "Database unspecified"
|
38
41
|
@postspec ||= Postspec.new(
|
39
42
|
PgConn.new(@database),
|
40
|
-
mode: mode, reflector: @reflections, anchors: @anchors, fail: @fail_fast, ignore: @ignore)
|
43
|
+
mode: mode, reflector: @reflections, anchors: @anchors, fail: @fail_fast, ignore: @ignore, cache: cache)
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
data/lib/postspec/version.rb
CHANGED