Class: Testa::Test

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, description, options = {}, &block) ⇒ Test

Returns a new instance of Test.



62
63
64
65
66
67
68
# File 'lib/testa.rb', line 62

def initialize location, description, options={}, &block
  @location = location
  @description = description
  @options = options
  @block = block
  @result = nil
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



60
61
62
# File 'lib/testa.rb', line 60

def description
  @description
end

#locationObject

Returns the value of attribute location.



60
61
62
# File 'lib/testa.rb', line 60

def location
  @location
end

#optionsObject

Returns the value of attribute options.



60
61
62
# File 'lib/testa.rb', line 60

def options
  @options
end

#resultObject

Returns the value of attribute result.



60
61
62
# File 'lib/testa.rb', line 60

def result
  @result
end

Instance Method Details

#callObject



70
71
72
# File 'lib/testa.rb', line 70

def call
  @result ||= Result.new self, *_call
end

#in_context(&block) ⇒ Object



74
75
76
# File 'lib/testa.rb', line 74

def in_context &block
  (@context ||= Context.new).instance_eval &block
end