Sha256: e99bad782630bb23e3c5ecdcd27ba79a483256ddb1fbfb0846149b84630cd728

Contents?: true

Size: 739 Bytes

Versions: 5

Compression:

Stored size: 739 Bytes

Contents

require 'spec_helper'

module OrElse
  describe Nothing do
    subject(:nothing) { Nothing }

    describe '#value' do
      specify { expect { nothing.value }.to raise_error }
    end

    describe '#map' do
      specify { expect(nothing.map).to eq Nothing }
    end

    describe '#flat_map' do
      specify { expect(nothing.flat_map).to eq Nothing }
    end

    describe '#empty?' do
      specify { expect(nothing.empty?).to be_true }
    end

    describe '#nil?' do
      specify { expect(nothing.nil?).to be_true }
    end

    describe '#exists?' do
      specify { expect(nothing.exists?).to be_false }
    end

    describe '#or_else' do
      specify { expect { |b| nothing.or_else(&b) }.to yield_control }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
or_else-0.0.5 spec/or_else/nothing_spec.rb
or_else-0.0.4 spec/or_else/nothing_spec.rb
or_else-0.0.3 spec/or_else/nothing_spec.rb
or_else-0.0.2 spec/or_else/nothing_spec.rb
or_else-0.0.1 spec/or_else/nothing_spec.rb