Class: GlobalRegistry::Bindings::Testing

Inherits:
Object
  • Object
show all
Defined in:
lib/global_registry_bindings/testing.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.__test_modeObject

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

Returns:

  • (Boolean)


35
36
37
# File 'lib/global_registry_bindings/testing.rb', line 35

def disabled?
  __test_mode == :disable
end

.enabled?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/global_registry_bindings/testing.rb', line 31

def enabled?
  __test_mode != :disable
end

.skip?Boolean

Returns:

  • (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