Sha256: eecccb09abc4da555b211971f4caec232f30f512c1332fa6f0478554287e0a75

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true
RSpec.describe WannabeBool::InvalidValueBehaviour do
  context 'False' do
    describe '#call' do
      subject { WannabeBool::InvalidValueBehaviour::False.call }
      it { is_expected.to be false }
    end
  end

  context 'Nil' do
    describe '#call' do
      subject { WannabeBool::InvalidValueBehaviour::Nil.call }
      it { is_expected.to be nil }
    end
  end

  context 'Error' do
    describe '#call' do
      subject { WannabeBool::InvalidValueBehaviour::Error.call }
      it { expect { subject }.to raise_error(ArgumentError, 'is not a valid boolean representation') }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wannabe_bool-0.7.1 spec/wannabe_bool/invalid_value_behaviour_spec.rb