Class: Inspec::RunnerMock
- Inherits:
-
Object
- Object
- Inspec::RunnerMock
- Defined in:
- lib/inspec/runner_mock.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
writeonly
Sets the attribute backend.
-
#profiles ⇒ Object
readonly
Returns the value of attribute profiles.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
- #add_profile(profile) ⇒ Object
- #add_test(example, _rule) ⇒ Object
- #example_group(*in_args, &in_block) ⇒ Object
-
#initialize ⇒ RunnerMock
constructor
A new instance of RunnerMock.
- #reset ⇒ Object
- #run(_with = nil) ⇒ Object
Constructor Details
#initialize ⇒ RunnerMock
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
8 9 10 |
# File 'lib/inspec/runner_mock.rb', line 8 def backend=(value) @backend = value end |
#profiles ⇒ Object (readonly)
Returns the value of attribute profiles.
7 8 9 |
# File 'lib/inspec/runner_mock.rb', line 7 def profiles @profiles end |
#tests ⇒ Object (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 |
#reset ⇒ Object
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 |