Sha256: 1dea169d32493fd0ed0bbebac31877f39df65ed2ef3fad4b14a4c2523808cdde

Contents?: true

Size: 705 Bytes

Versions: 9

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

describe Virtus::ValueObject::InstanceMethods, '#with' do
  subject { object.with(attributes) }

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

      attribute :first_name, String
      attribute :last_name,  String
    end
  end

  let(:object)     { described_class.new }
  let(:attributes) { Hash[:first_name => 'John', :last_name => 'Doe'] }

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

      attribute :first_name, String
      attribute :last_name,  String
    end
  end

  it { should be_instance_of(described_class) }

  its(:first_name) { should eql('John') }
  its(:last_name)  { should eql('Doe')  }
end

Version data entries

9 entries across 9 versions & 2 rubygems

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