add empty
This commit is contained in:
parent
58da4805fa
commit
6ebfc505c4
4 changed files with 42 additions and 1 deletions
16
spec/models/logic/empty_spec.rb
Normal file
16
spec/models/logic/empty_spec.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue