Class: Crspec::Configuration
- Inherits:
-
Object
- Object
- Crspec::Configuration
- Defined in:
- lib/crspec/configuration.rb
Instance Attribute Summary collapse
-
#after_hooks ⇒ Object
readonly
Returns the value of attribute after_hooks.
-
#around_hooks ⇒ Object
readonly
Returns the value of attribute around_hooks.
-
#before_hooks ⇒ Object
readonly
Returns the value of attribute before_hooks.
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#included_modules ⇒ Object
readonly
Returns the value of attribute included_modules.
-
#use_transactional_fixtures ⇒ Object
Returns the value of attribute use_transactional_fixtures.
Instance Method Summary collapse
- #after(_scope = :each, &block) ⇒ Object
- #around(_scope = :each, &block) ⇒ Object
- #before(_scope = :each, &block) ⇒ Object
- #include(mod) ⇒ Object
- #infer_spec_type? ⇒ Boolean
- #infer_spec_type_from_file_location! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/crspec/configuration.rb', line 10 def initialize @concurrency = Etc.nprocessors @use_transactional_fixtures = true @formatter = nil @before_hooks = [] @after_hooks = [] @around_hooks = [] @included_modules = [] @infer_spec_type = false end |
Instance Attribute Details
#after_hooks ⇒ Object (readonly)
Returns the value of attribute after_hooks.
8 9 10 |
# File 'lib/crspec/configuration.rb', line 8 def after_hooks @after_hooks end |
#around_hooks ⇒ Object (readonly)
Returns the value of attribute around_hooks.
8 9 10 |
# File 'lib/crspec/configuration.rb', line 8 def around_hooks @around_hooks end |
#before_hooks ⇒ Object (readonly)
Returns the value of attribute before_hooks.
8 9 10 |
# File 'lib/crspec/configuration.rb', line 8 def before_hooks @before_hooks end |
#concurrency ⇒ Object
Returns the value of attribute concurrency.
7 8 9 |
# File 'lib/crspec/configuration.rb', line 7 def concurrency @concurrency end |
#formatter ⇒ Object
Returns the value of attribute formatter.
7 8 9 |
# File 'lib/crspec/configuration.rb', line 7 def formatter @formatter end |
#included_modules ⇒ Object (readonly)
Returns the value of attribute included_modules.
8 9 10 |
# File 'lib/crspec/configuration.rb', line 8 def included_modules @included_modules end |
#use_transactional_fixtures ⇒ Object
Returns the value of attribute use_transactional_fixtures.
7 8 9 |
# File 'lib/crspec/configuration.rb', line 7 def use_transactional_fixtures @use_transactional_fixtures end |
Instance Method Details
#after(_scope = :each, &block) ⇒ Object
25 26 27 |
# File 'lib/crspec/configuration.rb', line 25 def after(_scope = :each, &block) @after_hooks.unshift(block) end |
#around(_scope = :each, &block) ⇒ Object
29 30 31 |
# File 'lib/crspec/configuration.rb', line 29 def around(_scope = :each, &block) @around_hooks << block end |
#before(_scope = :each, &block) ⇒ Object
21 22 23 |
# File 'lib/crspec/configuration.rb', line 21 def before(_scope = :each, &block) @before_hooks << block end |
#include(mod) ⇒ Object
33 34 35 |
# File 'lib/crspec/configuration.rb', line 33 def include(mod) @included_modules << mod end |
#infer_spec_type? ⇒ Boolean
41 42 43 |
# File 'lib/crspec/configuration.rb', line 41 def infer_spec_type? !!@infer_spec_type end |
#infer_spec_type_from_file_location! ⇒ Object
37 38 39 |
# File 'lib/crspec/configuration.rb', line 37 def infer_spec_type_from_file_location! @infer_spec_type = true end |