Class: RSpec::Puppet::EventListener

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

Class Method Summary collapse

Class Method Details

.example_failed(example) ⇒ Object



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

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

.example_passed(example) ⇒ Object



12
13
14
# File 'lib/rspec-puppet/monkey_patches.rb', line 12

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

.example_pending(example) ⇒ Object



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

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

.example_started(example) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/rspec-puppet/monkey_patches.rb', line 4

def self.example_started(example)
  if rspec3?
    @rspec_puppet_example = example.example.example_group.ancestors.include?(RSpec::Puppet::Support)
  else
    @rspec_puppet_example = example.example_group.ancestors.include?(RSpec::Puppet::Support)
  end
end

.rspec3?Boolean

Returns:

  • (Boolean)


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

def self.rspec3?
  if @rspec3.nil?
    @rspec3 = defined?(RSpec::Core::Notifications)
  end

  @rspec3
end

.rspec_puppet_example?Boolean

Returns:

  • (Boolean)


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

def self.rspec_puppet_example?
  @rspec_puppet_example || false
end