Class: Inspec::OrTest
- Inherits:
-
Object
- Object
- Inspec::OrTest
- Defined in:
- lib/inspec/objects/or_test.rb
Instance Method Summary collapse
-
#initialize(tests) ⇒ OrTest
constructor
A new instance of OrTest.
- #skip ⇒ Object
- #to_hash ⇒ Object
- #to_ruby ⇒ Object
Constructor Details
#initialize(tests) ⇒ OrTest
Returns a new instance of OrTest.
5 6 7 |
# File 'lib/inspec/objects/or_test.rb', line 5 def initialize(tests) @tests = tests end |
Instance Method Details
#skip ⇒ Object
9 10 11 |
# File 'lib/inspec/objects/or_test.rb', line 9 def skip nil end |
#to_hash ⇒ Object
18 19 20 |
# File 'lib/inspec/objects/or_test.rb', line 18 def to_hash { describe_one: @tests.map(&:to_hash) } end |
#to_ruby ⇒ Object
13 14 15 16 |
# File 'lib/inspec/objects/or_test.rb', line 13 def to_ruby all_tests = @tests.map(&:to_ruby).join("\n").gsub("\n", "\n ") format("describe.one do\n %s\nend", all_tests) end |