Class: Rubinium::TestBase

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

Class Method Summary collapse

Class Method Details

.errorsObject



76
77
78
# File 'lib/rubinium/test_base.rb', line 76

def self.errors
  @errors ||= []
end

.filenameObject



73
74
75
# File 'lib/rubinium/test_base.rb', line 73

def self.filename
  @filename || self.to_s + ".html"
end

.generate(io = "") ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rubinium/test_base.rb', line 51

def self.generate(io = "")
  script = @test_actions.map do |line|
    verb, object = line
    target = object[0]
    value = object[1] || " "
    "#{" " * 6}<tr><td>#{verb}</td><td>#{target}</td><td>#{value}</td></tr>"
  end.join("\n")
  fullscript = <<EOF
<html><head><title>#{self.name.to_s}</title></head>
<body>
  <table border="1">
<tbody>
<tr><td colspan="3">#{self.to_s} Test</td></tr>
#{script}
</tbody>
  </table>
</body>
</html>
EOF
  io << fullscript
  io
end

.metaclassObject



5
# File 'lib/rubinium/test_base.rb', line 5

def self.metaclass; class << self; self; end; end

.validate(*actions) ⇒ Object



45
46
47
48
49
50
# File 'lib/rubinium/test_base.rb', line 45

def self.validate(*actions)
  actions.each do |action| 
    @validators ||= {}
    @validators[action] = :validateOpen
  end
end