Class: Inspec::RunnerMock

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/runner_mock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunnerMock

Returns a new instance of RunnerMock.



9
10
11
# File 'lib/inspec/runner_mock.rb', line 9

def initialize
  reset
end

Instance Attribute Details

#backend=(value) ⇒ Object (writeonly)

Sets the attribute backend

Parameters:

  • value

    the value to set the attribute backend to.



8
9
10
# File 'lib/inspec/runner_mock.rb', line 8

def backend=(value)
  @backend = value
end

#profilesObject (readonly)

Returns the value of attribute profiles.



7
8
9
# File 'lib/inspec/runner_mock.rb', line 7

def profiles
  @profiles
end

#testsObject (readonly)

Returns the value of attribute tests.



7
8
9
# File 'lib/inspec/runner_mock.rb', line 7

def tests
  @tests
end

Instance Method Details

#add_profile(profile) ⇒ Object



18
19
20
# File 'lib/inspec/runner_mock.rb', line 18

def add_profile(profile)
  @profiles.push(profile)
end

#add_test(example, _rule) ⇒ Object



22
23
24
# File 'lib/inspec/runner_mock.rb', line 22

def add_test(example, _rule)
  @tests.push(example)
end

#example_group(*in_args, &in_block) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/inspec/runner_mock.rb', line 26

def example_group(*in_args, &in_block)
  Class.new do
    define_method :args do
      in_args
    end
    define_method :block do
      in_block
    end
  end
end

#resetObject



13
14
15
16
# File 'lib/inspec/runner_mock.rb', line 13

def reset
  @tests = []
  @profiles = []
end

#run(_with = nil) ⇒ Object



37
38
39
# File 'lib/inspec/runner_mock.rb', line 37

def run(_with = nil)
  puts 'uhm.... nothing or something... dunno, ask your admin'
end