spec/rubabel/molecule_spec.rb in rubabel-0.2.1 vs spec/rubabel/molecule_spec.rb in rubabel-0.2.2
- old
+ new
@@ -86,9 +86,21 @@
ar.first.el.should == :c
ar.last.el.should == :o
ar.size.should == 2
end
+ specify 'num_atoms gives the number of atoms which can vary with hydrogens added' do
+ mol = Rubabel["CCC"]
+ mol.num_atoms.should == 3
+ mol.add_h!
+ mol.num_atoms.should == 11
+ end
+
+ specify 'num_atoms(true) gives the number including implied hydrogens' do
+ mol = Rubabel["CCC"]
+ mol.num_atoms(true).should == 11
+ end
+
describe 'adding an atom' do
it 'can be added but not attached' do
mol = Rubabel["CCO"]
atom = mol.add_atom!(:n)
atom.el.should == :n