Sha256: 170cab0c2ece0dd34594bb471326dbcf7815d145f6b5dcc625b99c305bbb2bd2

Contents?: true

Size: 612 Bytes

Versions: 12

Compression:

Stored size: 612 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute, '.coerce' do
  subject { described_class.coerce }

  after :all do
    described_class.coerce(true)
  end

  context 'with a value' do
    it 'sets the value and return self' do
      expect(described_class.coerce(false)).to be(described_class)
      expect(subject).to be(false)
    end
  end

  context 'when it is set to true' do
    before do
      described_class.coerce(true)
    end

    it { should be(true) }
  end

  context 'when it is set to false' do
    before do
      described_class.coerce(false)
    end

    it { should be(false) }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
virtus-1.0.3 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.2 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.1 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.rc2 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.rc1 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta8 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta7 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta6 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta5 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta4 spec/unit/virtus/attribute/class_methods/coerce_spec.rb
virtus-1.0.0.beta3 spec/unit/virtus/attribute/class_methods/coerce_spec.rb