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_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)


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

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

  @rspec3
end

.rspec_puppet_example?Boolean

Returns:

  • (Boolean)


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

def self.rspec_puppet_example?
  @rspec_puppet_example || false
end