Sha256: 0c3cb0ecf576378f0cec003d9e0d209fe0a4300ecf481ce1c582931977a2f25a

Contents?: true

Size: 1.15 KB

Versions: 23

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  describe Boolean do

    let(:described) { Vedeu::Boolean }
    let(:instance)  { described.new(_value) }
    let(:_value)    {}

    describe '#initialize' do
      it { instance.must_be_instance_of(Vedeu::Boolean) }
    end

    describe '#false?' do
      subject { instance.false? }

      context 'when the value is nil' do
        it { subject.must_equal(true) }
      end

      context 'when the value is false' do
        let(:_value) { false }

        it { subject.must_equal(true) }
      end

      context 'when the value is anything else' do
        let(:_value) { :anything }

        it { subject.must_equal(false) }
      end
    end

    describe '#true?' do
      subject { instance.true? }

      context 'when the value is nil' do
        it { subject.must_equal(false) }
      end

      context 'when the value is true' do
        let(:_value) { true }

        it { subject.must_equal(true) }
      end

      context 'when the value is anything else' do
        let(:_value) { :anything }

        it { subject.must_equal(true) }
      end
    end

  end # Boolean

end # Vedeu

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
vedeu-0.8.24 test/lib/vedeu/boolean_test.rb
vedeu-0.8.23 test/lib/vedeu/boolean_test.rb
vedeu-0.8.22 test/lib/vedeu/boolean_test.rb
vedeu-0.8.21 test/lib/vedeu/boolean_test.rb
vedeu-0.8.20 test/lib/vedeu/boolean_test.rb
vedeu-0.8.19 test/lib/vedeu/boolean_test.rb
vedeu-0.8.18 test/lib/vedeu/boolean_test.rb
vedeu-0.8.17 test/lib/vedeu/boolean_test.rb
vedeu-0.8.16 test/lib/vedeu/boolean_test.rb
vedeu-0.8.15 test/lib/vedeu/boolean_test.rb
vedeu-0.8.14 test/lib/vedeu/boolean_test.rb
vedeu-0.8.13 test/lib/vedeu/boolean_test.rb
vedeu-0.8.12 test/lib/vedeu/boolean_test.rb
vedeu-0.8.10 test/lib/vedeu/boolean_test.rb
vedeu-0.8.9 test/lib/vedeu/boolean_test.rb
vedeu-0.8.8 test/lib/vedeu/boolean_test.rb
vedeu-0.8.7 test/lib/vedeu/boolean_test.rb
vedeu-0.8.6 test/lib/vedeu/boolean_test.rb
vedeu-0.8.5 test/lib/vedeu/boolean_test.rb
vedeu-0.8.4 test/lib/vedeu/boolean_test.rb