Class: Simulator::TestRun
- Inherits:
-
Object
- Object
- Simulator::TestRun
- Includes:
- Base
- Defined in:
- lib/logpoop/simulator/test_run.rb
Constant Summary collapse
- EF =
%w{ E F }
Instance Method Summary collapse
- #a_dot_or_an_e_or_an_f ⇒ Object
- #fake_it ⇒ Object
-
#initialize(out) ⇒ TestRun
constructor
A new instance of TestRun.
Methods included from Base
#clear_screen, included, #simulate, #stop
Constructor Details
#initialize(out) ⇒ TestRun
Returns a new instance of TestRun.
7 8 9 |
# File 'lib/logpoop/simulator/test_run.rb', line 7 def initialize(out) self.out = out end |
Instance Method Details
#a_dot_or_an_e_or_an_f ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/logpoop/simulator/test_run.rb', line 11 def a_dot_or_an_e_or_an_f if(rand(100) % 10 == 0) EF[rand(EF.length)] else "." end end |
#fake_it ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/logpoop/simulator/test_run.rb', line 19 def fake_it clear_screen(self.out) self.out.puts(Dir.pwd.strip + " $ rake test") self.out.puts("(in #{Dir.pwd.strip})") self.out.puts("Started") while !@stop do out.write(a_dot_or_an_e_or_an_f) out.flush sleep(rand(20) / 50.0) end clear_screen(self.out) end |