Class: CodeDrivenDevelopment::TestComponent::Test
- Inherits:
-
Object
- Object
- CodeDrivenDevelopment::TestComponent::Test
- Defined in:
- lib/code_driven_development/test_component/test.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#description ⇒ Object
Returns the value of attribute description.
Instance Method Summary collapse
- #indented_output(io) ⇒ Object
-
#initialize(description = "", body = "") ⇒ Test
constructor
A new instance of Test.
Constructor Details
#initialize(description = "", body = "") ⇒ Test
Returns a new instance of Test.
4 5 6 |
# File 'lib/code_driven_development/test_component/test.rb', line 4 def initialize(description = "", body = "") @description, @body = description, body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
8 9 10 |
# File 'lib/code_driven_development/test_component/test.rb', line 8 def body @body end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/code_driven_development/test_component/test.rb', line 8 def description @description end |
Instance Method Details
#indented_output(io) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/code_driven_development/test_component/test.rb', line 10 def indented_output io io << "it \"#@description\" do" io.indented do body.each { |line| io << line } end io << "end" end |