2022-06-09 13:48:45 +02:00
|
|
|
describe Logic::Eq do
|
|
|
|
include Logic
|
|
|
|
|
|
|
|
describe '#compute' do
|
|
|
|
it { expect(ds_eq(constant(1), constant(1)).compute).to be(true) }
|
|
|
|
it { expect(ds_eq(constant(1), constant(2)).compute).to be(false) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#errors' do
|
|
|
|
it { expect(ds_eq(constant(true), constant(true)).errors).to be_empty }
|
2022-09-14 10:43:18 +02:00
|
|
|
it do
|
|
|
|
expected = {
|
|
|
|
operator_name: "Logic::Eq",
|
|
|
|
right: constant(1),
|
|
|
|
stable_id: nil,
|
|
|
|
type: :incompatible
|
|
|
|
}
|
|
|
|
expect(ds_eq(constant(true), constant(1)).errors).to eq([expected])
|
|
|
|
end
|
2022-06-09 13:48:45 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe '#==' do
|
|
|
|
it { expect(ds_eq(constant(true), constant(false))).to eq(ds_eq(constant(false), constant(true))) }
|
|
|
|
end
|
|
|
|
end
|