1
0
mirror of https://github.com/cmur2/openvpn-status-web.git synced 2025-06-29 10:30:23 +02:00

Add some parser tests

This commit is contained in:
cn
2013-05-03 21:38:10 +02:00
parent 468e002162
commit 457aec64db
3 changed files with 62 additions and 0 deletions

21
spec/spec_helper.rb Normal file
View File

@ -0,0 +1,21 @@
require 'rubygems'
require 'bundler/setup'
require 'rack/test'
require 'openvpn-status-web'
def status_v1
text = File.open('examples/status.v1', 'rb') do |f| f.read end
OpenVPNStatusWeb::Parser::V1.new.parse_status_log text
end
def status_v2
text = File.open('examples/status.v2', 'rb') do |f| f.read end
OpenVPNStatusWeb::Parser::V2.new.parse_status_log text
end
def status_v3
text = File.open('examples/status.v3', 'rb') do |f| f.read end
OpenVPNStatusWeb::Parser::V3.new.parse_status_log text
end