Sha256: adecc22fcb876a9d6852ac16b9c81cfbd4a34c14a7b6fa96f8258466d108acb2
Contents?: true
Size: 755 Bytes
Versions: 11
Compression:
Stored size: 755 Bytes
Contents
require "spec_helper" RSpec.describe SmsAero::Types::Birthday do subject { described_class[source] } context "date:" do let(:source) { Date.parse "1901-08-17" } it { is_expected.to eq "1901-08-17" } end context "datetime:" do let(:source) { DateTime.parse "1901-08-17 10:00:00" } it { is_expected.to eq "1901-08-17" } end context "time:" do let(:source) { Time.parse "1901-08-17 10:00:00" } it { is_expected.to eq "1901-08-17" } end context "parceable string:" do let(:source) { "1901/08/17" } it { is_expected.to eq "1901-08-17" } end context "imparceable string:" do let(:source) { "Foobar" } it "fails" do expect { subject }.to raise_error(TypeError, /Foobar/) end end end
Version data entries
11 entries across 11 versions & 1 rubygems