Sha256: b1349a02d282e401adad99274c08bdf1db6bbef36c4cc0748cd2c2651076e977

Contents?: true

Size: 918 Bytes

Versions: 5

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'
class Predicate
  describe Predicate, "attr_split" do

    let(:p){ Predicate }
    subject{ pred.attr_split }

    context "on tautology" do
      let(:pred){ p.tautology }

      it{ should eq({}) }
    end

    context "on contradiction" do
      let(:pred){ p.contradiction }

      it{ should eq({ nil => pred }) }
    end

    context "on identifier" do
      let(:pred){ p.identifier(:x) }

      it{ should eq({ x: pred }) }
    end

    context "on not" do
      let(:pred){ p.not(:x) }

      it{ should eq({ x: pred }) }
    end

    context "on eq" do
      let(:pred){ p.eq(:x, 2) }

      it{ should eq({ x: pred }) }
    end

    context "on match" do
      let(:pred){ p.match(:x, "London") }

      it{ should eq({ x: pred }) }
    end

    context "on match with two identifiers" do
      let(:pred){ p.match(:x, :y) }

      it{ should eq({ nil => pred }) }
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
predicate-2.2.1 spec/predicate/test_attr_split.rb
predicate-2.2.0 spec/predicate/test_attr_split.rb
predicate-2.1.0 spec/predicate/test_attr_split.rb
predicate-2.0.1 spec/predicate/test_attr_split.rb
predicate-2.0.0 spec/predicate/test_attr_split.rb