Sha256: adc94355e71d916837a4bc607258c67d434ac02bfe0202eadf0043a72c3faf85

Contents?: true

Size: 1.14 KB

Versions: 25

Compression:

Stored size: 1.14 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").describe_many!(['MS:1000576', 'MS:1000514'])
    rfgroup2 = Mspire::Mzml::ReferenceableParamGroup.new("intensityArray").describe_many!(['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").describe_many!(['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

25 entries across 25 versions & 1 rubygems

Version Path
mspire-0.10.8.0 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.7.3 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.7.2 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.7.1 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.7 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.6 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.5 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.4 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.3 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.2 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.1 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.10.0 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.9.2 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.9.1 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.9.0 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.8.7 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.8.6.2 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.8.6.1 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.8.6 spec/mspire/mzml/referenceable_param_group_spec.rb
mspire-0.8.5 spec/mspire/mzml/referenceable_param_group_spec.rb