Sha256: e4eb15c2a208a327b8b704426e96a7e9d7e52835384560659372b6fe0ab2bfdb

Contents?: true

Size: 419 Bytes

Versions: 12

Compression:

Stored size: 419 Bytes

Contents

require 'spec_helper'

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

  let(:object)  { described_class.build(String, options) }
  let(:options) { Hash[:coerce => coerce] }

  context 'when :coerce is set to true' do
    let(:coerce) { true }

    it { should be(true) }
  end

  context 'when :coerce is set to false' do
    let(:coerce) { false }

    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/coercible_predicate_spec.rb
virtus-1.0.2 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.1 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.rc2 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.rc1 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta8 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta7 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta6 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta5 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta4 spec/unit/virtus/attribute/coercible_predicate_spec.rb
virtus-1.0.0.beta3 spec/unit/virtus/attribute/coercible_predicate_spec.rb