Sha256: aa11d61d835bb3a9c31e312db071f4e1adee90ff76cd3ff5ba636d28f1f7fe8b

Contents?: true

Size: 840 Bytes

Versions: 5

Compression:

Stored size: 840 Bytes

Contents

require "test_helper"

describe "any? all? and none?" do
  let(:order) { Order.new }

  def setup
    reset_order
    Order.add_to_booleans a: 1, c: 3, b: 7
  end

  it "checks any?" do
    order.a = true
    assert order.booleans_any?(:a, :b)
    order.a = false
    refute order.booleans_any?(:a, :b)
  end

  it "checks any? #2" do
    order.b = true
    assert order.booleans_any?(:a, :b)
    order.b = false
    refute order.booleans_any?(:a, :b)
  end

  it "checks all?" do
    order.a = order.b = true
    assert order.booleans_all?(:a, :b)
    order.a = false
    refute order.booleans_all?(:a, :b)
  end

  it "checks none? #2" do
    order.a = order.b = true
    refute order.booleans_none?(:a, :b)
    order.a = false
    refute order.booleans_none?(:a, :b)
    order.b = false
    assert order.booleans_none?(:a, :b)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
act_with_booleans-0.0.5 test/any_all_none_test.rb
act_with_booleans-0.0.4 test/any_all_none_test.rb
act_with_booleans-0.0.3 test/any_all_none_test.rb
act_with_booleans-0.0.2 test/any_all_none_test.rb
act_with_booleans-0.0.1 test/any_all_none_test.rb