Sha256: cc32aa2134a7d3bd84a2d4481e19ef61070b086f174966401e6014a58b682945

Contents?: true

Size: 392 Bytes

Versions: 8

Compression:

Stored size: 392 Bytes

Contents

require 'spec_helper'

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

  let(:object) { described_class.build(String, :required => required) }

  context 'when required option is true' do
    let(:required) { true }

    it { should be(true) }
  end

  context 'when required option is false' do
    let(:required) { false }

    it { should be(false) }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
virtus-1.0.3 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.2 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.1 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.0 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.0.rc2 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.0.rc1 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.0.beta8 spec/unit/virtus/attribute/required_predicate_spec.rb
virtus-1.0.0.beta7 spec/unit/virtus/attribute/required_predicate_spec.rb