Sha256: 2172feca1e543178233a6d5cc020b4515aabf82e72b4616ad5bb5cf422d55923

Contents?: true

Size: 425 Bytes

Versions: 11

Compression:

Stored size: 425 Bytes

Contents

require 'spec_helper'

describe Virtus::ValueObject, '#initialize' do
  subject { described_class.new(attributes) }

  let(:described_class) do
    Class.new do
      include Virtus::ValueObject

      attribute :currency, String
      attribute :amount,   Integer
    end
  end

  let(:attributes) { Hash[:currency => 'USD', :amount => 1] }

  its(:currency) { should eql('USD') }
  its(:amount)   { should eql(1)     }
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.5.4 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.5.3 spec/unit/virtus/value_object/initialize_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.5.2 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.5.1 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.5.0 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.4.2 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.4.1 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.4.0 spec/unit/virtus/value_object/initialize_spec.rb
virtus-0.3.0 spec/unit/virtus/value_object/initialize_spec.rb