Class: Turn::TestMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/turn/components/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TestMethod

Returns a new instance of TestMethod.



9
10
11
12
13
14
# File 'lib/turn/components/method.rb', line 9

def initialize(name)
  @name    = name
  @fail    = false
  @error   = false
  @message = nil
end

Instance Attribute Details

#fileObject

Returns the value of attribute file.



6
7
8
# File 'lib/turn/components/method.rb', line 6

def file
  @file
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/turn/components/method.rb', line 7

def message
  @message
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/turn/components/method.rb', line 5

def name
  @name
end

Instance Method Details

#error!(message = nil) ⇒ Object



21
22
23
24
# File 'lib/turn/components/method.rb', line 21

def error!(message=nil)
  @fail, @error = false, true
  @message = message if message
end

#error?Boolean

Returns:

  • (Boolean)


27
# File 'lib/turn/components/method.rb', line 27

def error? ; @error ; end

#fail!(message = nil) ⇒ Object



16
17
18
19
# File 'lib/turn/components/method.rb', line 16

def fail!(message=nil)
  @fail, @error = true, false
  @message = message if message
end

#fail?Boolean

Returns:

  • (Boolean)


26
# File 'lib/turn/components/method.rb', line 26

def fail?  ; @fail  ; end

#pass?Boolean

Returns:

  • (Boolean)


28
# File 'lib/turn/components/method.rb', line 28

def pass?  ; !(@fail or @error) ; end