Module: UnionTest
- Defined in:
- lib/type_struct/union_test.rb
Constant Summary collapse
- U =
Union.new(TrueClass, FalseClass)
Instance Method Summary collapse
Instance Method Details
#test_class_or(t) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/type_struct/union_test.rb', line 39 def test_class_or(t) u = TrueClass | FalseClass unless u === true t.error("error") end end |
#test_equal(t) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/type_struct/union_test.rb', line 25 def test_equal(t) unless U === true t.error("union error") end unless U === false t.error("union error") end if U === nil t.error("union error") end end |