Sha256: 0c2acf50428e5733564e156752aa618298c638fc41f5e3f14c22eaf76bef002a

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

class ParseTester
  include Munin::Parser
end

describe Munin::Parser do
  before :each do
    @parser = ParseTester.new
  end
  
  it 'parses version request' do
    @parser.parse_version(fixture('version.txt')).should == '1.4.4'
    
    proc { @parser.parse_version("some other response") }.
      should raise_error Munin::InvalidResponse, "Invalid version response"
  end
  
  it 'parses config request' do
    c = @parser.parse_config(fixture('config.txt').strip.split("\n"))
    c.should be_a Hash
    c['graph'].should be_a Hash
    c['graph']['args']['raw'].should == '--base 1024 -l 0 --upper-limit 16175665152'
    c['graph']['args']['parsed'].keys.should == %w(base l upper-limit)
    c['metrics'].should be_an Hash
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
munin-ruby-0.2.1 spec/parser_spec.rb