Sha256: 32b01ecec7414d4c868ecc892a25a985b3ef2c0f50c7a34941eb9bfb9e929b41

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'
require 'builder'

require 'ms/mzml/referenceable_param_group'

describe MS::Mzml::ReferenceableParamGroup do

  it 'is created with an id and params' do
    # the id is required for these objects
    # no compression
    rfgroup1 = MS::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
    rfgroup2 = MS::Mzml::ReferenceableParamGroup.new("intensityArray", params: ['MS:1000576', 'MS:1000515'])

    b = Builder::XmlMarkup.new(:indent => 2)
    z = MS::Mzml::ReferenceableParamGroup.list_xml([rfgroup1, rfgroup2], b)
    xml = b.to_xml
    [/referenceableParamGroupList.*count="2/, /cvParam.*cvRef/, /id="intensityArray"/].each do |regexp|
      xml.should match(regexp)
    end
  end

  it '#to_xml gives a ReferenceableParamGroupRef' do
    rfgroup1 = MS::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
    builder = Builder::XmlMarkup.new(:indent => 2)
    rfgroup1.to_xml(builder)
    xml = builder.to_xml
    [/referenceableParamGroupRef/, /ref="mzArray"/].each do |regexp|
      xml.should match(regexp)
    end
  end


end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mspire-0.6.26 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.25 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.24 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.22 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.21 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.20 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.19 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.18 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.12 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.11 spec/ms/mzml/referenceable_param_group_spec.rb
mspire-0.6.9 spec/ms/mzml/referenceable_param_group_spec.rb