Sha256: ff0759097161f33d59e2b6631e9e77c9d0d11d2322d71607b9212a68f8fed892

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

require 'pione/test-helper'

describe 'Pione::Location::BroadcastScheme' do
  it 'should be parsed as broadcast scheme' do
    URI.parse("broadcast://255.255.255.255").should.be.pione
  end

  it 'should be storage' do
    URI.parse("broadcast://255.255.255.255").should.be.not.storage
  end

  it 'should be broadcast scheme URI' do
    URI.parse("broadcast://255.255.255.255").should.kind_of Pione::Location::BroadcastScheme
  end

  it 'should get scheme name' do
    URI.parse("broadcast://255.255.255.255").scheme.should == 'broadcast'
  end

  it 'should get the address and port of "broadcast://255.255.255.255"' do
    URI.parse("broadcast://255.255.255.255").tap do |uri|
      uri.host.should == '255.255.255.255'
      uri.port.should == nil
    end
  end

  it 'should get the address and port of "broadcast://255.255.255.255:12345"' do
    URI.parse("broadcast://255.255.255.255:12345").tap do |uri|
      uri.host.should == '255.255.255.255'
      uri.port.should == 12345
    end
  end

  it 'should get the address and port of "broadcast://"' do
    URI.parse("broadcast://").tap do |uri|
      uri.host.should == nil
      uri.port.should == nil
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/location/spec_broadcast-scheme.rb
pione-0.5.0.alpha.2 test/location/spec_broadcast-scheme.rb
pione-0.5.0.alpha.1 test/location/spec_broadcast-scheme.rb
pione-0.4.2 test/location/spec_broadcast-scheme.rb
pione-0.4.1 test/location/spec_broadcast-scheme.rb
pione-0.4.0 test/location/spec_broadcast-scheme.rb
pione-0.3.2 test/location/spec_broadcast-scheme.rb
pione-0.3.1 test/location/spec_broadcast-scheme.rb
pione-0.3.0 test/location/spec_broadcast-scheme.rb