Sha256: bcacfbd6669f33d5191dfa614e99b891871c4ed6fbcab13c6189bffe1bac770f
Contents?: true
Size: 646 Bytes
Versions: 11
Compression:
Stored size: 646 Bytes
Contents
require 'spec_helper' class Predicate describe Predicate, "|" do let(:left) { Predicate.coerce(x: 2) } subject{ left | right } before do subject.should be_a(Predicate) end context 'with itself' do let(:right){ left } it{ should be(left) } end context 'with the same expression' do let(:right){ Predicate.coerce(x: 2) } it{ should be(left) } end context 'with another predicate' do let(:right){ Predicate.coerce(y: 3) } it 'should be a expected' do subject.to_ruby_code.should eq("->(t){ (t[:x] == 2) || (t[:y] == 3) }") end end end end
Version data entries
11 entries across 11 versions & 1 rubygems