Sha256: f09fa4120add20af7f633cc4034b788f4600852b9c90e258354fb10a71bf3625

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute, '#reader_visibility' do
  subject { object.reader_visibility }

  let(:object)          { described_class.new(:name, options)                              }
  let(:options)         { { :primitive => primitive, :coercion_method => coercion_method } }
  let(:primitive)       { stub('primitive')                                                }
  let(:coercion_method) { stub('coercion_method')                                          }

  context 'when not specified' do
    it { should be(:public) }
  end

  context 'when specified' do
    let(:reader) { stub('reader') }

    before do
      options.update(:reader => reader)
    end

    it { should be(reader) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virtus-0.2.0 spec/unit/virtus/attribute/reader_visibility_spec.rb
virtus-0.1.0 spec/unit/virtus/attribute/reader_visibility_spec.rb