Sha256: e2169ce64aff143b502b426929e277fde6533c639c1e3e5b3ced3fbf71fedad4

Contents?: true

Size: 854 Bytes

Versions: 12

Compression:

Stored size: 854 Bytes

Contents

require "spec_helper.rb"
require 'ms/calc'

describe 'Ms::Calc - calculating ppm tolerances' do
  extend Ms::Calc
  
  it "returns the ppm tolerance at the specified mass, ppm" do
    ppm_tol_at(100, 100).is 0.01
    ppm_tol_at(1000, 100).is 0.1
    ppm_tol_at(1000, 10).is 0.01
  end
  
  it "works for any numeric inputs" do
    ppm_tol_at(100, 100).is 0.01
    ppm_tol_at(100.0, 100.0).is 0.01
    ppm_tol_at(1e2, 1e2).is 0.01
  end

  it "should return a span of ppm_tol_at centered on the specified mass" do
    ppm_span_at(100, 100).is [99.99, 100.01]
    ppm_span_at(1000, 100).is [999.9, 1000.1]
    ppm_span_at(1000, 10).is [999.99, 1000.01]
  end
  
  it "should work for any numeric inputs" do
    ppm_span_at(100, 100).is [99.99, 100.01]
    ppm_span_at(100.0, 100.0).is [99.99, 100.01]
    ppm_span_at(1e2, 1e2).is [99.99, 100.01]
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ms-core-0.0.19 spec/ms/calc_spec.rb
ms-core-0.0.18 spec/ms/calc_spec.rb
ms-core-0.0.17 spec/ms/calc_spec.rb
ms-core-0.0.16 spec/ms/calc_spec.rb
ms-core-0.0.14 spec/ms/calc_spec.rb
ms-core-0.0.13 spec/ms/calc_spec.rb
ms-core-0.0.12 spec/ms/calc_spec.rb
ms-core-0.0.11 spec/ms/calc_spec.rb
ms-core-0.0.10 spec/ms/calc_spec.rb
ms-core-0.0.9 spec/ms/calc_spec.rb
ms-core-0.0.7 spec/ms/calc_spec.rb
ms-core-0.0.6 spec/ms/calc_spec.rb