require 'test/unit' require 'test/framework' require 'units' class TC_system_create < Test::Unit::TestCase understands UnitsTest def test_system_create Units.create :length do |m| m.system 'english' m.system 'metric' end english = Units.length.english metric = Units.length.metric assert(english.kind_of?(UnitsSystem)) assert(metric.kind_of?(UnitsSystem)) assert(english.name == 'english') assert(metric.name == 'metric') assert(english.units_measure == Units.length) assert(metric.units_measure == Units.length) assert(Units.length.keys.index('english') != nil) assert(Units.length.keys.index('metric') != nil) assert(Units.length.keys.index('foo') == nil) end end