Sha256: 267b451f3e9a82de9757aff7dc0165178834ecb4acdf10545943f3429f20eb5f
Contents?: true
Size: 791 Bytes
Versions: 5
Compression:
Stored size: 791 Bytes
Contents
RSpec.describe Fear::None do include Fear::Option::Mixin it_behaves_like Fear::RightBiased::Left do let(:left) { None() } end subject(:none) { None() } describe '#get' do subject { proc { none.get } } it { is_expected.to raise_error(Fear::NoSuchElementError) } end describe '#or_nil' do subject { none.or_nil } it { is_expected.to eq(nil) } end describe '#empty?' do subject { none.empty? } it { is_expected.to eq(true) } end describe '#select' do subject { none.select { |value| value > 42 } } it 'always return None' do is_expected.to eq(None()) end end describe '#reject' do subject { none.reject { |value| value > 42 } } it 'always return None' do is_expected.to eq(None()) end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
fear-0.5.0 | spec/fear/none_spec.rb |
fear-0.4.2 | spec/fear/none_spec.rb |
fear-0.4.1 | spec/fear/none_spec.rb |
fear-0.4.0 | spec/fear/none_spec.rb |
fear-0.3.0 | spec/fear/none_spec.rb |