spec/zenlish/feature/enumeration_domain_spec.rb in zenlish-0.2.04 vs spec/zenlish/feature/enumeration_domain_spec.rb in zenlish-0.2.05
- old
+ new
@@ -28,15 +28,19 @@
it 'should provide a factory method for enumerated value' do
expect(subject.build_value(:plural)).to be_kind_of(SymbolValue)
value = subject.build_value(:plural)
expect(value.val).to eq(:plural)
end
+
+ it 'should return all valid values in domain when requested' do
+ expect(subject.to_a).to eq([:singular, :plural])
+ end
it 'should complain when asked to build a non-member value' do
err = StandardError
err_msg = "dual isn't part of enumeration [singular, plural]."
expect { subject.build_value(:dual) }.to raise_error(err, err_msg)
- end
+ end
end # context
end # describe
end # module
end # module