Sha256: 431630d6e1f2d8f9ad2c2a873c987879edd9eead41aa8839a203f61ef31e53ec

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

require 'test/unit'

require 'openbabel'
include OpenBabel

class OBTest < Test::Unit::TestCase
  def test_obmol
    # Code from http://goo.gl/9H1LZ

    smi2mol = OBConversion.new
    smi2mol.set_in_format("smi")

    mol = OBMol.new
    smi2mol.read_string(mol, 'CC(C)CCCC(C)C1CCC2C1(CCC3C2CC=C4C3(CCC(C4)O)C)C') # cholesterol, no chirality
    mol.add_hydrogens

    assert_equal(mol.num_atoms, 74)
    assert_in_delta(mol.get_mol_wt, 386.65, 0.1)
    assert_equal(mol.get_formula, "C27H46O")

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openbabel-2.4.90.0 test/test_openbabel.rb
openbabel-2.3.2.2 test/test_openbabel.rb