Sha256: 3529f770c0cf1c13243d54dbfcc1d11ab1ca8bc8b1b7179cb263f0b070922b99

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'
require 'json'
require 'duedil/struct'

describe Duedil::Struct do
  it 'can be used as a json object class' do
    struct = JSON.parse('{}', :object_class => Duedil::Struct)
    expect(struct).to be_instance_of Duedil::Struct
  end

  it 'provides snakecase reader methods for the json object members' do
    struct = JSON.parse('{"latestAnnualReturnDate":"2012-04-20"}', :object_class => Duedil::Struct)
    expect(struct.latest_annual_return_date).to be_eql '2012-04-20'
  end

  it 'responds to snakecase reader methods for the json object members' do
    struct = JSON.parse('{"latestAnnualReturnDate":"2012-04-20"}', :object_class => Duedil::Struct)
    expect(struct.respond_to?(:latest_annual_return_date)).to be_eql true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
duedil-client-0.0.1 spec/duedil/struct_spec.rb