Class: TestML
- Inherits:
-
Object
- Object
- TestML
- Defined in:
- lib/testml.rb,
lib/testml/setup.rb,
lib/testml/runtime.rb
Defined Under Namespace
Modules: Constant, Util Classes: Assertion, Assignment, Block, Bool, Bridge, Call, Callable, Compiler, Error, Expression, Function, Library, List, Native, None, Num, Object, Point, Runtime, Setup, Statement, Str, TestCase
Constant Summary collapse
- VERSION =
'0.0.2'
Instance Attribute Summary collapse
-
#bridge ⇒ Object
Returns the value of attribute bridge.
-
#compiler ⇒ Object
Returns the value of attribute compiler.
-
#library ⇒ Object
Returns the value of attribute library.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#testml ⇒ Object
Returns the value of attribute testml.
Instance Method Summary collapse
-
#initialize(attributes = {}) {|_self| ... } ⇒ TestML
constructor
A new instance of TestML.
- #run(*args) ⇒ Object
- #set_default_classes ⇒ Object
Constructor Details
#initialize(attributes = {}) {|_self| ... } ⇒ TestML
Returns a new instance of TestML.
10 11 12 13 |
# File 'lib/testml.rb', line 10 def initialize attributes={} attributes.each { |k,v| self.send "#{k}=", v } yield self if block_given? end |
Instance Attribute Details
#bridge ⇒ Object
Returns the value of attribute bridge.
6 7 8 |
# File 'lib/testml.rb', line 6 def bridge @bridge end |
#compiler ⇒ Object
Returns the value of attribute compiler.
5 6 7 |
# File 'lib/testml.rb', line 5 def compiler @compiler end |
#library ⇒ Object
Returns the value of attribute library.
7 8 9 |
# File 'lib/testml.rb', line 7 def library @library end |
#runtime ⇒ Object
Returns the value of attribute runtime.
4 5 6 |
# File 'lib/testml.rb', line 4 def runtime @runtime end |
#testml ⇒ Object
Returns the value of attribute testml.
8 9 10 |
# File 'lib/testml.rb', line 8 def testml @testml end |
Instance Method Details
#run(*args) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/testml.rb', line 15 def run(*args) set_default_classes @runtime.new( compiler: @compiler, bridge: @bridge, library: @library, testml: @testml, ).run(*args) end |
#set_default_classes ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/testml.rb', line 25 def set_default_classes if not @runtime require 'testml/runtime/unit' @runtime = TestML::Runtime::Unit end if not @compiler require 'testml/compiler/pegex' @compiler = TestML::Compiler::Pegex end if not @bridge require 'testml/bridge' @bridge = TestML::Bridge end if not @library require 'testml/library/standard' require 'testml/library/debug' @library = [ TestML::Library::Standard, TestML::Library::Debug, ] end end |