Class: GlobalRegistry::Bindings::Testing
- Inherits:
-
Object
- Object
- GlobalRegistry::Bindings::Testing
- Defined in:
- lib/global_registry_bindings/testing.rb
Class Attribute Summary collapse
-
.__test_mode ⇒ Object
Returns the value of attribute __test_mode.
Class Method Summary collapse
- .__set_test_mode(mode) ⇒ Object
- .disable_test_helper!(&block) ⇒ Object
- .disabled? ⇒ Boolean
- .enabled? ⇒ Boolean
- .skip? ⇒ Boolean
- .skip_workers!(&block) ⇒ Object
Class Attribute Details
.__test_mode ⇒ Object
Returns the value of attribute __test_mode.
7 8 9 |
# File 'lib/global_registry_bindings/testing.rb', line 7 def __test_mode @__test_mode end |
Class Method Details
.__set_test_mode(mode) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/global_registry_bindings/testing.rb', line 9 def __set_test_mode(mode) if block_given? current_mode = __test_mode begin self.__test_mode = mode yield ensure self.__test_mode = current_mode end else self.__test_mode = mode end end |
.disable_test_helper!(&block) ⇒ Object
27 28 29 |
# File 'lib/global_registry_bindings/testing.rb', line 27 def disable_test_helper!(&block) __set_test_mode(:disable, &block) end |
.disabled? ⇒ Boolean
35 36 37 |
# File 'lib/global_registry_bindings/testing.rb', line 35 def disabled? __test_mode == :disable end |
.enabled? ⇒ Boolean
31 32 33 |
# File 'lib/global_registry_bindings/testing.rb', line 31 def enabled? __test_mode != :disable end |
.skip? ⇒ Boolean
39 40 41 |
# File 'lib/global_registry_bindings/testing.rb', line 39 def skip? __test_mode == :skip end |
.skip_workers!(&block) ⇒ Object
23 24 25 |
# File 'lib/global_registry_bindings/testing.rb', line 23 def skip_workers!(&block) __set_test_mode(:skip, &block) end |