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.



5
6
7
# File 'lib/inspec/runner_mock.rb', line 5

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.



4
5
6
# File 'lib/inspec/runner_mock.rb', line 4

def backend=(value)
  @backend = value
end

#profilesObject (readonly)

Returns the value of attribute profiles.



3
4
5
# File 'lib/inspec/runner_mock.rb', line 3

def profiles
  @profiles
end

#testsObject (readonly)

Returns the value of attribute tests.



3
4
5
# File 'lib/inspec/runner_mock.rb', line 3

def tests
  @tests
end

Instance Method Details

#add_profile(profile) ⇒ Object



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

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

#add_test(example, _rule) ⇒ Object



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

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

#example_group(*in_args, &in_block) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/inspec/runner_mock.rb', line 22

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



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

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

#run(_with = nil) ⇒ Object



33
34
35
# File 'lib/inspec/runner_mock.rb', line 33

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