Sha256: 268b9e8e87c00d419bb46dfd2a87191c58b5954545088ca741a8a6a834058a3b

Contents?: true

Size: 381 Bytes

Versions: 7

Compression:

Stored size: 381 Bytes

Contents

require 'spec_helper'

describe Virtus::InstanceMethods, '#[]' do
  subject { object[:name] }

  let(:described_class) do
    Class.new do
      include Virtus
      attribute :name, String
    end
  end

  let(:object) do
    described_class.new(:name => value)
  end

  let(:value) do
    'john'
  end

  it "returns the value of an attribute" do
    should eql(value)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
virtus-0.0.10 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.9 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.8 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.7 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.6 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.5 spec/unit/virtus/instance_methods/element_reference_spec.rb
virtus-0.0.4 spec/unit/virtus/instance_methods/element_reference_spec.rb