Sha256: 1ec9f1346c4590a3d203ac7605648ed38e8b06475a2657f0d8b2af3ec29f2761

Contents?: true

Size: 1.14 KB

Versions: 15

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

require 'ms/ident/pepxml/search_hit/modification_info'

describe 'MS::Ident::Pepxml::SearchHit::ModificationInfo' do

  before do
    modaaobjs = [[3, 150.3], [6, 345.2]].map do |ar| 
      MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(*ar)
    end
    hash = {
      :mod_nterm_mass => 520.2,
      :modified_peptide => "MOD*IFI^E&D",
      :mod_aminoacid_masses => modaaobjs,
    }
    #answ = "<modification_info mod_nterm_mass=\"520.2\" modified_peptide=\"MOD*IFI^E&amp;D\">\n\t<mod_aminoacid_mass position=\"3\" mass=\"150.3\"/>\n\t<mod_aminoacid_mass position=\"6\" mass=\"345.2\"/>\n</modification_info>\n"
    @obj = MS::Ident::Pepxml::SearchHit::ModificationInfo.new(hash)
  end

  it 'can produce valid pepxml xml' do
    to_match = ['<modification_info',
    ' mod_nterm_mass="520.2"',
    " modified_peptide=\"MOD*IFI^E&amp;D\"",
    "<mod_aminoacid_mass",
    " position=\"3\"",
    " mass=\"150.3\"",
    " position=\"6\"",
    " mass=\"345.2\"",
    "</modification_info>"]
    string = @obj.to_xml
    to_match.each do |re|
      string.should match(Regexp.new(Regexp.escape(re)))
    end
  end
end


Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mspire-0.6.26 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.25 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.24 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.22 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.21 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.20 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.19 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.18 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.12 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.11 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.9 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.7 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.6 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.2 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb
mspire-0.6.1 spec/ms/ident/pepxml/search_hit/modification_info_spec.rb