Class: RSpec::Puppet::EventListener

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-puppet/monkey_patches.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.current_exampleObject (readonly)

Returns the value of attribute current_example.



38
39
40
# File 'lib/rspec-puppet/monkey_patches.rb', line 38

def current_example
  @current_example
end

Class Method Details

.example_failed(_example) ⇒ Object



29
30
31
# File 'lib/rspec-puppet/monkey_patches.rb', line 29

def self.example_failed(_example)
  @rspec_puppet_example = false
end

.example_passed(_example) ⇒ Object



21
22
23
# File 'lib/rspec-puppet/monkey_patches.rb', line 21

def self.example_passed(_example)
  @rspec_puppet_example = false
end

.example_pending(_example) ⇒ Object



25
26
27
# File 'lib/rspec-puppet/monkey_patches.rb', line 25

def self.example_pending(_example)
  @rspec_puppet_example = false
end

.example_started(example) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/rspec-puppet/monkey_patches.rb', line 13

def self.example_started(example)
  @rspec_puppet_example = example.example.example_group.ancestors.include?(RSpec::Puppet::Support)
  @current_example = example.example
  return unless !@current_example.respond_to?(:environment) && @current_example.respond_to?(:example_group_instance)

  @current_example = @current_example.example_group_instance
end

.rspec_puppet_example?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/rspec-puppet/monkey_patches.rb', line 33

def self.rspec_puppet_example?
  @rspec_puppet_example || false
end