Sha256: cb3f299837ba77a6d688702c3c3b6fc85ca6ab24b03962af6f5f22cac2e100ed

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8

describe Policy do

  let(:one) { double :one }
  let(:two) { double :two }

  describe ".and" do

    let(:composer) { Policy::Base::And }

    it "composes policies with And composer" do
      expect(composer).to receive(:new).with(one, two)
      described_class.and one, two
    end

  end # describe .and

  describe ".or" do

    let(:composer) { Policy::Base::Or }

    it "composes policies with Or composer" do
      expect(composer).to receive(:new).with(one, two)
      described_class.or one, two
    end

  end # describe .or

  describe ".xor" do

    let(:composer) { Policy::Base::Xor }

    it "composes policies with Xor composer" do
      expect(composer).to receive(:new).with(one, two)
      described_class.xor one, two
    end

  end # describe .xor

  describe ".not" do

    let(:composer) { Policy::Base::Not }

    it "composes policies with Not composer" do
      expect(composer).to receive(:new).with(one)
      described_class.not one
    end

  end # describe .not

end # describe Policy

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
policy-2.0.0 spec/tests/lib/policy_spec.rb