spec/lib/danica/wrapper/variable_spec.rb in danica-2.4.3 vs spec/lib/danica/wrapper/variable_spec.rb in danica-2.4.4

- old
+ new

@@ -5,9 +5,21 @@ it_behaves_like 'an object with basic operation' do subject { described_class.new(value: 100) } end + it 'can be initialize from nil value' do + expect do + described_class.new(nil) + end + end + + it 'can be initialize from nil name' do + expect do + described_class.new(name: nil) + end + end + describe '#to_f' do context 'when variable has no value' do it { expect { subject.to_f }.to raise_error(Danica::Exception::NotDefined) } end