Sha256: 1508b9ba3a2fecbe08053af5d7877638fd82fdfd3947edb4a2476061f292be27
Contents?: true
Size: 655 Bytes
Versions: 12
Compression:
Stored size: 655 Bytes
Contents
require 'spec_helper' module Finitio describe ProcWithCode do it 'acts like a proc' do p = ProcWithCode.new{|t| t>0 } expect(p).to be_a(Proc) expect(p.call(2)).to eq(true) expect(p.call(-2)).to eq(false) end it 'lets compile from source code' do p = ProcWithCode.new("t", "t>0") expect(p).to be_a(Proc) expect(p.call(2)).to eq(true) expect(p.call(-2)).to eq(false) end it 'yields equal procs for same source code' do p1 = ProcWithCode.new("t", "t>0") p2 = ProcWithCode.new("t", "t>0") expect(p1).to eql(p2) expect(p1.hash).to eql(p2.hash) end end end
Version data entries
12 entries across 12 versions & 1 rubygems