Module: Postspec
- Defined in:
- lib/postspec.rb,
lib/postspec/frame.rb,
lib/postspec/state.rb,
lib/postspec/config.rb,
lib/postspec/render.rb,
lib/postspec/version.rb,
lib/postspec/environment.rb
Overview
Used to initialize postspec from spec/spec_helper.rb or spec/postspec_helper.rb
Defined Under Namespace
Classes: Config, EmptyFrame, Environment, FoxFrame, Frame, FrameStack, NopFrame, Postspec, Render, SeedFrame, State
Constant Summary
collapse
- DEFAULT_MODE =
:empty
- DEFAULT_FAIL_FAST =
true
- DEFAULT_IGNORE =
[]
- VERSION =
"0.5.5"
Class Method Summary
collapse
Class Method Details
.anchors ⇒ Object
21
|
# File 'lib/postspec/config.rb', line 21
def self.anchors() @anchors end
|
.cache ⇒ Object
24
|
# File 'lib/postspec/config.rb', line 24
def self.cache() @cache end
|
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/postspec/config.rb', line 26
def self.configure(&block)
config = Config.new(@database, DEFAULT_MODE, nil, nil, DEFAULT_FAIL_FAST, DEFAULT_IGNORE, nil)
yield(config)
@database = config.database
@mode = config.mode || DEFAULT_MODE
@reflections = config.reflections
@anchors = config.anchors
@fail_fast = config.fail_fast || DEFAULT_FAIL_FAST
@ignore = config.ignore || DEFAULT_IGNORE @cache = config.cache
self
end
|
.database ⇒ Object
18
|
# File 'lib/postspec/config.rb', line 18
def self.database() @database end
|
.fail_fast ⇒ Object
22
|
# File 'lib/postspec/config.rb', line 22
def self.fail_fast() @fail_fast end
|
.ignore ⇒ Object
23
|
# File 'lib/postspec/config.rb', line 23
def self.ignore() @ignore end
|
.mode ⇒ Object
19
|
# File 'lib/postspec/config.rb', line 19
def self.mode() @mode end
|
.postspec ⇒ Object
39
40
41
42
43
44
|
# File 'lib/postspec/config.rb', line 39
def self.postspec()
!@database.nil? or raise Error, "Database unspecified"
@postspec ||= Postspec.new(
PgConn.new(@database),
mode: mode, reflector: @reflections, anchors: @anchors, fail: @fail_fast, ignore: @ignore, cache: cache)
end
|
.reflections ⇒ Object
20
|
# File 'lib/postspec/config.rb', line 20
def self.reflections() @reflections end
|