class TOTS::Test
A single test case entity
Attributes
block[RW]
name[RW]
options[RW]
Public Class Methods
new(args)
click to toggle source
# File lib/tots/test.rb, line 10 def initialize(args) @block = args.last.is_a?(Proc) ? args.pop : skip @options = args.size > 1 && args.last.is_a?(Hash) ? args.pop : {} @name = args[0] || 'no name given' end
Public Instance Methods
run(context)
click to toggle source
# File lib/tots/test.rb, line 22 def run(context) test = self context.instance_eval do @test_options = test.options instance_eval &test.block end end
skip()
click to toggle source
# File lib/tots/test.rb, line 16 def skip @block = Proc.new do raise Skip end end