spec/integration/axiom/function/predicate/less_than/optimize_spec.rb in axiom-optimizer-0.1.0 vs spec/integration/axiom/function/predicate/less_than/optimize_spec.rb in axiom-optimizer-0.1.1
- old
+ new
@@ -3,62 +3,62 @@
require 'spec_helper'
describe Function::Predicate::LessThan, '#optimize' do
subject { object.optimize }
- let(:attribute) { Attribute::Integer.new(:id, :required => false, :size => 1..2**31-1) }
- let(:left) { attribute }
- let(:right) { attribute }
- let(:object) { described_class.new(left, right) }
+ let(:attribute) { Attribute::Integer.new(:id, required: false, size: 1..2**31 - 1) }
+ let(:left) { attribute }
+ let(:right) { attribute }
+ let(:object) { described_class.new(left, right) }
context 'left and right are attributes' do
context 'and equivalent' do
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
context 'and are not comparable' do
let(:right) { Attribute::Float.new(:float) }
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
context 'and left is always less than right' do
- let(:left) { attribute }
- let(:right) { Attribute::Integer.new(:right, :size => 2**31..2**31) }
+ let(:left) { attribute }
+ let(:right) { Attribute::Integer.new(:right, size: 2**31..2**31) }
- it { should equal(Function::Proposition::Tautology.instance) }
+ it { should be(Function::Proposition::Tautology.instance) }
it_should_behave_like 'an optimize method'
end
context 'and left is always greater than or equal to right' do
- let(:left) { attribute }
- let(:right) { Attribute::Integer.new(:right, :size => 0..0) }
+ let(:left) { attribute }
+ let(:right) { Attribute::Integer.new(:right, size: 0..0) }
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
context 'left is an attribute' do
context 'right is a valid value' do
let(:right) { 2 }
- it { should equal(object) }
+ it { should be(object) }
it_should_behave_like 'an optimize method'
end
context 'right is an invalid primitive' do
let(:right) { nil }
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
@@ -72,30 +72,30 @@
end
context 'left is an invalid primitive' do
let(:left) { nil }
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
context 'left and right are constants' do
context 'that will evaluate to a tautology' do
let(:left) { 1 }
let(:right) { 2 }
- it { should equal(Function::Proposition::Tautology.instance) }
+ it { should be(Function::Proposition::Tautology.instance) }
it_should_behave_like 'an optimize method'
end
context 'that will evaluate to a contradiction' do
let(:left) { 1 }
let(:right) { 1 }
- it { should equal(Function::Proposition::Contradiction.instance) }
+ it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
end