Class: Simulator::TestRun

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/logpoop/simulator/test_run.rb

Constant Summary collapse

EF =
%w{ E F }

Instance Method Summary collapse

Methods included from Base

#clear_screen, included, #initialize, #simulate, #stop

Instance Method Details

#a_dot_or_an_e_or_an_fObject



7
8
9
10
11
12
13
# File 'lib/logpoop/simulator/test_run.rb', line 7

def a_dot_or_an_e_or_an_f
  if(rand(100) % 10 == 0)
    EF[rand(EF.length)]
  else
    "."
  end
end

#fake_itObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/logpoop/simulator/test_run.rb', line 15

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