Sha256: 3e9cf5ef5d4ea441d21287389120710a30be5b3ffd5edc1131c2ec609ce92a3d

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

require 'spec_helper'
module Alf
  class Predicate
    describe Predicate, "to_ruby_code" do

      subject{ p.to_ruby_code }

      describe "on a comp(:eq)" do
        let(:p){ Predicate.coerce(:x => 2) }

        it{ should eq("->(t){ t.x == 2 }") }
      end

      describe "with qualified identifiers" do
        let(:p){ Predicate.eq(Factory.qualified_identifier(:t, :y), 2) }

        it{ should eq("->(t){ t.y == 2 }") }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-predicate/predicate/test_to_ruby_code.rb