Sha256: 459321f0d71a4ad41d8450f8e248cd9e378a31014265a3e45a6d841ec475a6bc

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'net/dav'
require 'spec'
require 'spec/autorun'

Spec::Runner.configure do |config|

end

# Wait for webdav server to start up
def wait_for_server(address)
  server_running = false
  dav = Net::DAV.new(address)
  count = 0
  while(not(server_running))
    begin
      sleep(0.1)
      props = dav.propfind("/").to_s
      if(props.match(/200 OK/))
        server_running = true
      else
        warn "Webdav server should return \"200 OK\" "
        exit(1)
      end
    rescue
      count += 1
      puts "Server not running. Retrying..." if ((count % 10) == 0)
    end
  end
  dav = nil
end

# Profind helper. Returns properties or error
def find_props_or_error(dav, path)
  begin
    return dav.propfind(path).to_s
  rescue Net::HTTPServerException => e
    return e.to_s
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
net_dav-0.5.0 spec/spec_helper.rb
net_dav-0.4.1 spec/spec_helper.rb