Sha256: 50328db918a3d82677315ecafa4d72689d133f273587a86ba643713bd9682cda

Contents?: true

Size: 398 Bytes

Versions: 10

Compression:

Stored size: 398 Bytes

Contents

require 'test_helper'

class POROTest < MiniTest::Unit::TestCase
  class MyPORO
    include SimpleEnum

    attr_accessor :gender_cd
    as_enum :gender, [:male, :female]
  end

  def test_reading_and_writing
    poro = POROTest::MyPORO.new
    poro.gender_cd = 1
    assert_equal :female, poro.gender

    poro.male!
    assert_equal 0, poro.gender_cd
    assert_equal :male, poro.gender
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
simple_enum-1.6.9 test/poro_test.rb
simple_enum-1.6.8 test/poro_test.rb
simple_enum-1.6.7 test/poro_test.rb
simple_enum-1.6.5 test/poro_test.rb
simple_enum-1.6.4 test/poro_test.rb
simple_enum-1.6.3 test/poro_test.rb
simple_enum-1.6.2 test/poro_test.rb
simple_enum-1.6.1 test/poro_test.rb
simple_enum-1.5.1 test/poro_test.rb
simple_enum-1.5.0 test/poro_test.rb