Sha256: 1e06ed667c8c481078b521e1edd8face491670d6aaa1450e77a45a74f4abab64

Contents?: true

Size: 526 Bytes

Versions: 5

Compression:

Stored size: 526 Bytes

Contents

require 'spec_helper'

describe Virtus::ClassMethods, '#attributes' do
  subject { object.attributes }

  before do
    @original_stderr, $stderr = $stderr, StringIO.new
  end

  after do
    $stderr = @original_stderr
  end

  let(:object) { Class.new { extend Virtus::ClassMethods } }

  it { should be_instance_of(Virtus::AttributeSet) }

  it 'returns a deprecation warning' do
    subject
    $stderr.string.should =~ /\A#{object}.attributes is deprecated. Use #{object}.attribute_set instead: #{__FILE__}:4\b/
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/unit/virtus/class_methods/attributes_spec.rb
virtus-0.5.4 spec/unit/virtus/class_methods/attributes_spec.rb
virtus-0.5.3 spec/unit/virtus/class_methods/attributes_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/class_methods/attributes_spec.rb
virtus-0.5.2 spec/unit/virtus/class_methods/attributes_spec.rb