Sha256: 6b7297ef30a77cb50d8f1725549ceaf0c7ee02202ffcc906683d5c192dc9ad2a
Contents?: true
Size: 1.59 KB
Versions: 7
Compression:
Stored size: 1.59 KB
Contents
# frozen_string_literal: true require_relative '../../../lib/zenlish/feature/enumeration_domain' # Load the class under test require_relative '../../../lib/zenlish/feature/feature_def' module Zenlish module Feature describe FeatureDef do let(:a_name) { 'NUMBER' } let(:a_domain) { EnumerationDomain.new(:singular, :plural) } subject { FeatureDef.new(a_name, a_domain) } context 'Initialization:' do it 'should be initialized with at least two arguments' do expect { FeatureDef.new(a_name, a_domain) }.not_to raise_error end it 'could be initialized with a default value argument' do deflt = double('dummy') expect { FeatureDef.new(a_name, a_domain, deflt) }.not_to raise_error end it 'should know its name' do expect(subject.name).to eq(a_name) end it 'should know the domain of its values' do expect(subject.domain).to eq(a_domain) end it 'should know the domain of its default value' do expect(subject.default).to be_nil deflt = double('dummy') instance = FeatureDef.new(a_name, a_domain, deflt) expect(instance.default).to eq(deflt) end it 'should guess its default if enumeration has a single member' do basic_domain = EnumerationDomain.new(:plural) instance = FeatureDef.new(a_name, basic_domain) expect(instance.default.val).to eq(:plural) end end # context context 'Provided services:' do end # context end # describe end # module end # module
Version data entries
7 entries across 7 versions & 1 rubygems