Sha256: b61523e5a73625bc1d7a198999dac63ec1e55747e59e3be3db1aa8b98fa8d79b

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 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_a Hash
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
munin-ruby-0.2.5 spec/parser_spec.rb
munin-ruby-0.2.4 spec/parser_spec.rb
munin-ruby-0.2.3 spec/parser_spec.rb
munin-ruby-0.2.2 spec/parser_spec.rb