Sha256: b9d3c012fcf862d97c2b6d18fe6507a3865d27a124d42388d18c5dbdda93c65c

Contents?: true

Size: 526 Bytes

Versions: 8

Compression:

Stored size: 526 Bytes

Contents

require "test_helper"

class A < Order
  add_to_flags x: 1, y: 2
end

describe "inheritance" do
  let(:a) { A.create }

  def setup
    reset_order
    Order.add_to_flags z: 3
  end

  it "consistency" do
    assert a.respond_to?(:x)
    assert a.respond_to?(:y)
    assert_equal false, a.x
    assert_equal false, a.y
    a.y = true
    assert_equal true, a.y
  end

  it "checks any?" do
    a.x = true
    assert a.flags_any?(:x, :y)

    assert_raises(RuntimeError) {
      assert a.flags_any?(:x, :y, :z)
    }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
act_with_flags-3.1.9 test/inheritance_any_test.rb
act_with_flags-3.1.6 test/inheritance_any_test.rb
act_with_flags-3.1.5 test/inheritance_any_test.rb
act_with_flags-3.1.3 test/inheritance_any_test.rb
act_with_flags-3.1.2 test/inheritance_any_test.rb
act_with_flags-3.1.1 test/inheritance_any_test.rb
act_with_flags-3.1.0 test/inheritance_any_test.rb
act_with_flags-3.0.1 test/inheritance_any_test.rb