Class: Tina4::Testing::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/tina4/testing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TestSuite

Returns a new instance of TestSuite.



198
199
200
201
202
203
# File 'lib/tina4/testing.rb', line 198

def initialize(name)
  @name = name
  @tests = []
  @before_each = nil
  @after_each = nil
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



196
197
198
# File 'lib/tina4/testing.rb', line 196

def name
  @name
end

#testsObject (readonly)

Returns the value of attribute tests.



196
197
198
# File 'lib/tina4/testing.rb', line 196

def tests
  @tests
end

Instance Method Details

#after_each(&block) ⇒ Object



213
214
215
# File 'lib/tina4/testing.rb', line 213

def after_each(&block)
  @after_each = block
end

#before_each(&block) ⇒ Object



209
210
211
# File 'lib/tina4/testing.rb', line 209

def before_each(&block)
  @before_each = block
end

#it(description, &block) ⇒ Object



205
206
207
# File 'lib/tina4/testing.rb', line 205

def it(description, &block)
  @tests << { name: description, block: block }
end

#run_after_eachObject



221
222
223
# File 'lib/tina4/testing.rb', line 221

def run_after_each
  @after_each&.call
end

#run_before_eachObject



217
218
219
# File 'lib/tina4/testing.rb', line 217

def run_before_each
  @before_each&.call
end