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.



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

def initialize
  @tests = []
end

Instance Attribute Details

#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_test(example, _rule_id) ⇒ Object



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

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

#example_group(*in_args, &in_block) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/inspec/runner_mock.rb', line 16

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

#run(_with = nil) ⇒ Object



27
28
29
# File 'lib/inspec/runner_mock.rb', line 27

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