Sha256: 1d16bbbedda2edbe571d5b0ffba70fbc3975ba16854e5abc5dc94b727606e9dd

Contents?: true

Size: 751 Bytes

Versions: 18

Compression:

Stored size: 751 Bytes

Contents

require 'spec_helper'

describe Frodo::Properties::DateTime do
  let(:subject) { Frodo::Properties::DateTime.new('DateTime', '2000-01-01T16:00:00.000') }
  let(:new_datetime) { DateTime.strptime('2004-05-01T14:32:00.000', '%Y-%m-%dT%H:%M:%S.%L') }

  it { expect(subject.type).to eq('Edm.DateTime') }
  it { expect(subject.value).to eq(DateTime.parse('2000-01-01T16:00:00.000')) }

  it { expect(subject.url_value).to eq("2000-01-01T16:00:00.000")}

  it { expect {subject.value = 'bad'}.to raise_error(ArgumentError) }

  it { expect(lambda {
    subject.value = '2004-05-01T14:32:00.000'
    subject.value
  }.call).to eq(new_datetime) }

  it { expect(lambda {
    subject.value = new_datetime
    subject.value
  }.call).to eq(new_datetime) }
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
frodo-0.12.8 spec/frodo/properties/date_time_spec.rb
frodo-0.12.7 spec/frodo/properties/date_time_spec.rb
frodo-0.12.6 spec/frodo/properties/date_time_spec.rb
frodo-0.12.5 spec/frodo/properties/date_time_spec.rb
frodo-0.12.4 spec/frodo/properties/date_time_spec.rb
frodo-0.12.2 spec/frodo/properties/date_time_spec.rb
frodo-0.12.1 spec/frodo/properties/date_time_spec.rb
frodo-0.12.0 spec/frodo/properties/date_time_spec.rb
frodo-0.11.0 spec/frodo/properties/date_time_spec.rb
frodo-0.10.8 spec/frodo/properties/date_time_spec.rb
frodo-0.10.7 spec/frodo/properties/date_time_spec.rb
frodo-0.10.6 spec/frodo/properties/date_time_spec.rb
frodo-0.10.5 spec/frodo/properties/date_time_spec.rb
frodo-0.10.4 spec/frodo/properties/date_time_spec.rb
frodo-0.10.3 spec/frodo/properties/date_time_spec.rb
frodo-0.10.2 spec/frodo/properties/date_time_spec.rb
frodo-0.10.1 spec/frodo/properties/date_time_spec.rb
frodo-0.10.0 spec/frodo/properties/date_time_spec.rb