lib/rspactor/interactor.rb in guillaumegentil-rspactor-0.4.3 vs lib/rspactor/interactor.rb in guillaumegentil-rspactor-0.5.1
- old
+ new
@@ -8,14 +8,24 @@
def initialize(runner)
@runner = runner
ticker
end
- def wait_for_enter_key(msg, seconds_to_wait)
+ def self.ticker_msg(msg, seconds_to_wait = 2)
+ $stdout.print msg
+ seconds_to_wait.times do
+ $stdout.print('.')
+ $stdout.flush
+ sleep 1
+ end
+ $stdout.puts "\n"
+ end
+
+ def wait_for_enter_key(msg, seconds_to_wait, clear = runner.options[:clear])
begin
Timeout::timeout(seconds_to_wait) do
- system("clear;") if runner.options[:clear]
+ system("clear;") if clear
ticker(:start => true, :msg => msg)
$stdin.gets
return true
end
rescue Timeout::Error
@@ -35,10 +45,10 @@
when "c\n" # Cucumber: current tagged feature
runner.run_cucumber_command
when "ca\n" # Cucumber All: ~pending tagged feature
runner.run_cucumber_command('~pending')
else
- if wait_for_enter_key("** Running all specs.. Hit <enter> again to exit RSpactor", 1)
+ if wait_for_enter_key("** Running all specs... Hit <enter> again to exit RSpactor", 1)
@main_thread.exit
exit
end
runner.run_all_specs
end
\ No newline at end of file