Sha256: 239f898d8718bde65951636009073446f6fefb6a2030facbf831f1528fdc2d4b
Contents?: true
Size: 1.98 KB
Versions: 1
Compression:
Stored size: 1.98 KB
Contents
require 'spec_helper' describe OpenVPNStatusWeb::Parser::ModernStateless do { 2 => status_v2, 3 => status_v3 }.each do |version, status| context "for status-version #{version}" do context 'for client list' do it 'parses common names' do expect(status.client_list.map { |client| client[0] }).to eq(["foo", "bar"]) end it 'parses real addresses' do expect(status.client_list.map { |client| client[1] }).to eq(["1.2.3.4:1234", "1.2.3.5:1235"]) end it 'parses received bytes' do expect(status.client_list.map { |client| client[2] }).to eq([11811160064, 512]) end it 'parses sent bytes' do expect(status.client_list.map { |client| client[3] }).to eq([4194304, 2048]) end it 'parses connected since date' do expect(status.client_list.map { |client| client[4] }).to eq([DateTime.new(2012,1,1,23,42,0), DateTime.new(2012,1,1,23,42,0)]) end end context 'for routing table' do it 'parses virtual addresses' do expect(status.routing_table.map { |route| route[0] }).to eq(["192.168.0.0/24", "192.168.66.2", "192.168.66.3", "2001:db8:0:0::1000"]) end it 'parses common names' do expect(status.routing_table.map { |route| route[1] }).to eq(["foo", "bar", "foo", "bar"]) end it 'parses real addresses' do expect(status.routing_table.map { |route| route[2] }).to eq(["1.2.3.4:1234", "1.2.3.5:1235", "1.2.3.4:1234", "1.2.3.5:1235"]) end it 'parses last ref date' do expect(status.routing_table.map { |route| route[3] }).to eq([DateTime.new(2012,1,1,23,42,0), DateTime.new(2012,1,1,23,42,0), DateTime.new(2012,1,1,23,42,0), DateTime.new(2012,1,1,23,42,0)]) end end it 'parses global stats' do expect(status.global_stats.size).to eq(1) expect(status.global_stats.first).to eq(["Max bcast/mcast queue length", 42]) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openvpn-status-web-2.0.0 | spec/parser/modern_stateless_spec.rb |