lib/teuton/project/laboratory/dsl.rb in teuton-2.1.8 vs lib/teuton/project/laboratory/dsl.rb in teuton-2.1.9
- old
+ new
@@ -9,11 +9,11 @@
# * unique
# * log
# * set
class Laboratory
def readme(_text)
- # Usefull for "teuton reamde" action.
+ # Usefull for "teuton readme" command action.
end
def target(desc, args = {})
@stats[:targets] += 1
@targetid += 1
@@ -21,40 +21,38 @@
verboseln '(%03d' % @targetid + ") target #{desc}"
verboseln " weight #{weight}"
end
alias goal target
- def request(text)
- @requests << text.to_s
- end
+# def request(text)
+# @requests << text.to_s
+# end
def tempfile(_tempfile = nil)
'tempfile'
end
+ def run(command, args = {})
+ args[:exec] = command
+ host = :localhost
+ host = args[:on] if args[:on]
+ goto(host, args)
+ end
+
def goto(host = :localhost, args = {})
result.reset
+ args[:on] = host unless args[:on]
if @hosts[host]
@hosts[host] += 1
else
@hosts[host] = 1
end
- verboseln " goto #{host} and #{args}"
+ verboseln " run '#{args[:exec]}' on #{args[:on]}"
end
- def run(command, args = {})
- args[:exec] = command
- goto(:localhost, args)
- end
-
def expect(_cond, args = {})
- #unless [ String, Array, Regexp].include? _cond.class
- # verboseln "[ERROR] expect #{_cond} (#{_cond.class})"
- # return
- #end
verboseln " alter #{result.alterations}" unless result.alterations.empty?
- #verboseln " expect #{result.expected} (#{result.expected.class})"
verboseln " expect #{_cond} (#{_cond.class})"
verboseln ''
end
def expect_one(_cond, args = {})