add empty

This commit is contained in:
simon lehericey 2022-06-09 11:54:29 +02:00
parent 58da4805fa
commit 6ebfc505c4
4 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,16 @@
describe Logic::Constant do
include Logic
describe '#type' do
it { expect(empty.type).to eq(:empty) }
end
describe '#errors' do
it { expect(empty.errors).to eq(['empty']) }
end
describe '#==' do
it { expect(empty).to eq(empty) }
it { expect(empty).not_to eq(constant(true)) }
end
end

View file

@ -4,5 +4,7 @@ describe Logic do
it 'serializes deserializes' do
expect(Logic.from_h(constant(1).to_h)).to eq(constant(1))
expect(Logic.from_json(constant(1).to_json)).to eq(constant(1))
expect(Logic.from_h(empty.to_h)).to eq(empty)
end
end