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.
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
4 5 6 |
# File 'lib/inspec/runner_mock.rb', line 4 def backend=(value) @backend = value end |
#profiles ⇒ Object (readonly)
Returns the value of attribute profiles.
3 4 5 |
# File 'lib/inspec/runner_mock.rb', line 3 def profiles @profiles end |
#tests ⇒ Object (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 |
#reset ⇒ Object
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 |