Sha256: d68e848e82ffc6e29d70755dd826dbf18f50e5101d4f281e81bac894235dd856

Contents?: true

Size: 876 Bytes

Versions: 8

Compression:

Stored size: 876 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

require 'drbqs/server/check_alive'

describe DRbQS::Server::CheckAlive do
  it "should raise error with not a number" do
    lambda do
      DRbQS::Server::CheckAlive.new('abc')
    end.should raise_error
  end

  it "should raise error with a minus number" do
    lambda do
      DRbQS::Server::CheckAlive.new(-10)
    end.should raise_error    
  end

  it "should return true" do
    check = DRbQS::Server::CheckAlive.new(0.01)
    sleep(0.03)
    check.significant_interval?.should be_true
  end

  it "should return false" do
    check = DRbQS::Server::CheckAlive.new(100)
    check.significant_interval?.should be_false
  end

  it "should set checking" do
    check = DRbQS::Server::CheckAlive.new(0.1)
    sleep(0.2)
    check.set_checking
    check.significant_interval?.should be_false
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
drbqs-0.1.1 spec/server/check_alive_spec.rb
drbqs-0.1.0 spec/server/check_alive_spec.rb
drbqs-0.0.19 spec/server/check_alive_spec.rb
drbqs-0.0.18 spec/server/check_alive_spec.rb
drbqs-0.0.17 spec/server/check_alive_spec.rb
drbqs-0.0.16 spec/server/check_alive_spec.rb
drbqs-0.0.15 spec/server/check_alive_spec.rb
drbqs-0.0.14 spec/server/check_alive_spec.rb