Sha256: 6f1d1b03d9bc3f3b6c755ff83adaa117292d9dedad383fca5a2453d2ed52fdf7

Contents?: true

Size: 621 Bytes

Versions: 4

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe Virtus::ClassMethods, '#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

4 entries across 4 versions & 1 rubygems

Version Path
virtus-0.4.2 spec/unit/virtus/class_methods/allowed_writer_methods_spec.rb
virtus-0.4.1 spec/unit/virtus/class_methods/allowed_writer_methods_spec.rb
virtus-0.4.0 spec/unit/virtus/class_methods/allowed_writer_methods_spec.rb
virtus-0.3.0 spec/unit/virtus/class_methods/allowed_writer_methods_spec.rb