Sha256: d05bcd72c76a994fad1575524376a642340fe7bf2b0ed304c7c75d885753f478

Contents?: true

Size: 485 Bytes

Versions: 5

Compression:

Stored size: 485 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Attribute::Boolean, '#valid_value?' do
  subject { object.valid_value?(value) }

  let(:object) { described_class.new(:boolean) }

  context 'with a true value' do
    let(:value) { true }

    it { should be(true) }
  end

  context 'with a false value' do
    let(:value) { false }

    it { should be(true) }
  end

  context 'with a value that is not true or false' do
    let(:value) { 1 }

    it { should be(false) }
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/attribute/boolean/valid_value_predicate_spec.rb
veritas-0.0.7 spec/unit/veritas/attribute/boolean/valid_value_spec.rb
veritas-0.0.6 spec/unit/veritas/attribute/boolean/valid_value_spec.rb
veritas-0.0.5 spec/unit/veritas/attribute/boolean/valid_value_spec.rb
veritas-0.0.4 spec/unit/veritas/attribute/boolean/valid_value_spec.rb