Sha256: 7660b71f6d95c0d8f0651355f9e8967490ec51982e2fc6b95fa92f9dec31255e

Contents?: true

Size: 619 Bytes

Versions: 7

Compression:

Stored size: 619 Bytes

Contents

require 'spec_helper'

describe Virtus::Extensions, '#allowed_writer_methods' do
  subject { object.allowed_writer_methods }

  let(:object) do
    Class.new do
      include Virtus
      attribute :virtus_attribute, String
      attr_accessor :some_other_attribute
    private
      attr_accessor :private_attribute
    end
  end

  it { should include('virtus_attribute=') }
  it { should include('some_other_attribute=') }
  it { should_not include('private_attribute=') }

  %w[ == != === []= attributes= ].each do |invalid_method|
    it { should_not include(invalid_method) }
  end

  it { should be_frozen }
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
virtus-0.5.4 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
virtus-0.5.3 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
virtus-0.5.2 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
virtus-0.5.1 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb
virtus-0.5.0 spec/unit/virtus/extensions/allowed_writer_methods_spec.rb