Merge pull request #7474 from betagouv/US/fix-global-include-for-logic

fix(spec): including Logic module broke spreadsheet architect
This commit is contained in:
mfo 2022-06-20 15:20:39 +02:00 committed by GitHub
commit 511c646b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,5 @@
include Logic
describe Logic::BinaryOperator do describe Logic::BinaryOperator do
include Logic
let(:two_greater_than_one) { greater_than(constant(2), constant(1)) } let(:two_greater_than_one) { greater_than(constant(2), constant(1)) }
describe '#type' do describe '#type' do
@ -22,6 +21,7 @@ describe Logic::BinaryOperator do
end end
describe Logic::GreaterThan do describe Logic::GreaterThan do
include Logic
it 'computes' do it 'computes' do
expect(greater_than(constant(1), constant(1)).compute).to be(false) expect(greater_than(constant(1), constant(1)).compute).to be(false)
expect(greater_than(constant(2), constant(1)).compute).to be(true) expect(greater_than(constant(2), constant(1)).compute).to be(true)
@ -29,6 +29,7 @@ describe Logic::GreaterThan do
end end
describe Logic::GreaterThanEq do describe Logic::GreaterThanEq do
include Logic
it 'computes' do it 'computes' do
expect(greater_than_eq(constant(0), constant(1)).compute).to be(false) expect(greater_than_eq(constant(0), constant(1)).compute).to be(false)
expect(greater_than_eq(constant(1), constant(1)).compute).to be(true) expect(greater_than_eq(constant(1), constant(1)).compute).to be(true)
@ -37,6 +38,7 @@ describe Logic::GreaterThanEq do
end end
describe Logic::LessThan do describe Logic::LessThan do
include Logic
it 'computes' do it 'computes' do
expect(less_than(constant(1), constant(1)).compute).to be(false) expect(less_than(constant(1), constant(1)).compute).to be(false)
expect(less_than(constant(1), constant(2)).compute).to be(true) expect(less_than(constant(1), constant(2)).compute).to be(true)
@ -44,6 +46,7 @@ describe Logic::LessThan do
end end
describe Logic::LessThanEq do describe Logic::LessThanEq do
include Logic
it 'computes' do it 'computes' do
expect(less_than_eq(constant(0), constant(1)).compute).to be(true) expect(less_than_eq(constant(0), constant(1)).compute).to be(true)
expect(less_than_eq(constant(1), constant(1)).compute).to be(true) expect(less_than_eq(constant(1), constant(1)).compute).to be(true)