Sha256: 80807dc0fed8b0a2a124a425435040d02d45fd578ce4b801feaada3d5540273c
Contents?: true
Size: 691 Bytes
Versions: 29
Compression:
Stored size: 691 Bytes
Contents
require "spec_helper" describe Myfinance::Entities::Base do class DummyEntity < Myfinance::Entities::Base attribute :property_1, String attribute :property_2, String end let(:hash) { { property_1: 1, property_2: 2 } } subject { DummyEntity.new(hash) } it "builds an object from a hash" do expect(subject).to respond_to(:property_1) expect(subject).to respond_to(:property_2) expect(subject.property_1).to eq("1") expect(subject.property_2).to eq("2") end describe "#attributes" do it "returns a hash from object attributes" do expect(subject.to_hash).to eq({ property_1: "1", property_2: "2" }) end end end
Version data entries
29 entries across 29 versions & 1 rubygems