Sha256: 5517287d2629c78d2cd41e61bc3278ff10ee20ab8992f114910ed1ccc20a0522

Contents?: true

Size: 1.12 KB

Versions: 14

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'
require 'builder'

require 'mspire/mzml/referenceable_param_group'

describe Mspire::Mzml::ReferenceableParamGroup do

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

    b = Builder::XmlMarkup.new(:indent => 2)
    z = Mspire::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 = Mspire::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

14 entries across 14 versions & 1 rubygems

Version Path
mspire-0.7.18 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.17 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.13 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.12 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.11 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.10 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.9 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.8 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.7 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.6 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.5 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.4 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.3 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.7.2 spec/mspire/mzml/referenceable_param_group_spec.rb