Sha256: c489e6333b281f3fb33aada8bb6be2651483d9513373b33dad18cfc8a49d6cd7

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

require 'spec_helper'

describe OData4::Properties::Date do
  let(:subject) { OData4::Properties::Date.new('Date', '2000-01-01') }
  let(:new_date) { Date.strptime('2004-05-01', '%Y-%m-%d') }

  it { expect(subject.type).to eq('Edm.Date') }
  it { expect(subject.value).to eq(Date.parse('2000-01-01')) }

  it { expect(subject.url_value).to eq("2000-01-01")}

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

  it { expect(lambda {
    subject.value = '2004-05-01'
    subject.value
  }.call).to eq(new_date) }

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
odata4-0.9.1 spec/odata4/properties/date_spec.rb
odata4-0.9.0 spec/odata4/properties/date_spec.rb
odata4-0.8.2 spec/odata4/properties/date_spec.rb
odata4-0.8.1 spec/odata4/properties/date_spec.rb
odata4-0.8.0 spec/odata4/properties/date_spec.rb
odata4-0.7.0 spec/odata4/properties/date_spec.rb