Class: CodeDrivenDevelopment::TestComponent::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/code_driven_development/test_component/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



8
9
10
# File 'lib/code_driven_development/test_component/test.rb', line 8

def body
  @body
end

#descriptionObject

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