Sha256: 6429152bbc9b4ac980e14ef3dcdc16d2ca119b5cf032802384569518d090e0d0

Contents?: true

Size: 1 KB

Versions: 43

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Marty::Diagnostic::Collection do
  def sample_data consistent = true
    node_a_data = described_class.pack(include_ip=false){'A'}
    data = {
      'NodeA' => node_a_data,
      'NodeB' => node_a_data,
    }
    return data if consistent
    data + {'NodeB' => {'Base' => described_class.error('B')}}
  end

  it 'all diagnostics in diagnostics class attribute are generated' do
    diags = [Marty::Diagnostic::Version, Marty::Diagnostic::Nodes]
    expected = diags.map{|d| d.generate}.reduce(:deep_merge)
    described_class.diagnostics = diags
    expect(described_class.generate).to eq(expected)
  end

  it 'declares data consistency via status consistency' do
    a = sample_data
    b = sample_data + {
      'NodeB' => described_class.pack(include_ip=false){'B'}
    }
    c = sample_data(consistent=false)

    expect(described_class.consistent?(a)).to eq(true)
    expect(described_class.consistent?(b)).to eq(true)
    expect(described_class.consistent?(c)).to eq(false)
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
marty-2.3.8 spec/other/diagnostic/collection_spec.rb
marty-2.3.7 spec/other/diagnostic/collection_spec.rb
marty-2.3.5 spec/other/diagnostic/collection_spec.rb
marty-2.3.4 spec/other/diagnostic/collection_spec.rb
marty-2.1.5 spec/other/diagnostic/collection_spec.rb
marty-2.3.2 spec/other/diagnostic/collection_spec.rb
marty-2.3.1 spec/other/diagnostic/collection_spec.rb
marty-2.3.0 spec/other/diagnostic/collection_spec.rb
marty-2.1.4 spec/other/diagnostic/collection_spec.rb
marty-2.1.3 spec/other/diagnostic/collection_spec.rb
marty-2.1.2 spec/other/diagnostic/collection_spec.rb
marty-2.1.1 spec/other/diagnostic/collection_spec.rb
marty-2.1.0 spec/other/diagnostic/collection_spec.rb
marty-2.0.9 spec/other/diagnostic/collection_spec.rb
marty-2.0.8 spec/other/diagnostic/collection_spec.rb
marty-2.0.7 spec/other/diagnostic/collection_spec.rb
marty-2.0.6 spec/other/diagnostic/collection_spec.rb
marty-2.0.5 spec/other/diagnostic/collection_spec.rb
marty-2.0.4 spec/other/diagnostic/collection_spec.rb
marty-2.0.3 spec/other/diagnostic/collection_spec.rb