Sha256: 9506896698c151aaf911280d2d0f365d0de5e2cf9a6aba1d7e51319e487d869c
Contents?: true
Size: 607 Bytes
Versions: 4
Compression:
Stored size: 607 Bytes
Contents
require 'spec_helper' module Alf describe "Support#coerce" do it 'coerces integers without trouble' do Support.coerce("12", Integer).should eql(12) end it 'coerces Time without trouble' do Support.coerce("2012-05-11 12:00:00.000000+0200", Time).should be_a(Time) end it 'coerces DateTime without trouble' do Support.coerce("2012-05-11 12:00:00.000000+0200", DateTime).should be_a(DateTime) end it 'should raise a TypeError in case of error' do lambda{ Support.coerce("abc", Integer) }.should raise_error(TypeError) end end end
Version data entries
4 entries across 4 versions & 1 rubygems