Sha256: b4551d449b5cc061b0824c44eac90038d4e2f56a049c53b5d0e79a6ab2380038

Contents?: true

Size: 1.11 KB

Versions: 39

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

require 'mspire/plms1'
require 'mspire/spectrum'

describe 'plms1 - Prince Lab MS 1 specification' do
  before do
    @keyfile = TESTFILES + "/plms1/output.key" 
    times = [0.55, 0.9]
    scan_numbers = [1,2]
    spectra = [
      Mspire::Spectrum.new([[300.0, 301.5, 303.1], [10, 20, 35.5]]),
      Mspire::Spectrum.new([[300.5, 302, 303.6], [11, 21, 36.5]])
    ]
    @plms1_obj = Mspire::Plms1.new(scan_numbers, times, spectra)
    @outfile = @keyfile.sub(/\.key$/, ".tmp")
  end

  it 'has a detailed specification' do
    specification = Mspire::Plms1::SPECIFICATION
    specification.should be_an_instance_of String
    (specification.size > 50).should == true
  end

  it 'writes a plms1 file' do
    @plms1_obj.write(@outfile)
    File.exist?(@outfile).should == true
    IO.read(@outfile, :mode => 'rb').should == IO.read(@keyfile, :mode => 'rb')
    File.unlink(@outfile) if File.exist?(@outfile)
  end

  it 'reads a plms1 file' do
    obj = Mspire::Plms1.new.read(@keyfile)
    [:scan_numbers, :times, :spectra].each do |val|
      obj.send(val).should == @plms1_obj.send(val)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

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