summaryrefslogtreecommitdiff
path: root/lib/vendor/excon/lib/excon/test/plugin/server/exec.rb
blob: ba12e24b1ab5a843df4b22f8aa76a5a447a61d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Excon
  module Test
    module Plugin
      module Server
        module Exec
          def start(app_str = app)
            line = ''
            open_process(app)
            until line =~ /\Aready\Z/
              line = error.gets
              fatal_time = elapsed_time > timeout
              if fatal_time
                msg = "executable #{app} has taken too long to start"
                raise msg
              end
            end
            true
          end
        end
      end
    end
  end
end