Sha256: cc65d14b5dc85efa9dd09335f8bd4fdaffdd41e0afba444b3dffd3f88f9bd0c8
Contents?: true
Size: 497 Bytes
Versions: 5
Compression:
Stored size: 497 Bytes
Contents
require 'spec_helper' describe Virtus::Coercion::String, '.to_date' do subject { object.to_date(string) } let(:object) { described_class } context 'with a valid date string' do let(:string) { "July, 22th, 2011" } it { should be_instance_of(Date) } its(:year) { should == 2011 } its(:month) { should == 7 } its(:day) { should == 22 } end context 'with an invalid date string' do let(:string) { 'non-date' } it { should equal(string) } end end
Version data entries
5 entries across 5 versions & 1 rubygems