Sha256: 2804aceefa82d0a40c283fdcfd2a8cc59faad1830ad7f7951e0df55e379f1b21

Contents?: true

Size: 594 Bytes

Versions: 34

Compression:

Stored size: 594 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt/annotations'

module TestEntityString
  extend Entity
  self.annotation :code
end

class TestAnnotation < Test::Unit::TestCase
  def test_marshal
    a = "STRING"
    a.extend Annotated

    assert !(Annotated === Marshal.load(Marshal.dump(a)))
    assert_equal a, Marshal.load(Marshal.dump(a))
  end

  def test_hash
    e = TestEntityString.setup("TEST", :code => 10)
    assert_equal "TEST", Annotated.to_hash(e)[:literal]
    assert_equal 10, Annotated.to_hash(e)[:info][:code]
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
rbbt-util-5.34.11 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.10 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.9 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.8 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.7 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.5 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.4 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.3 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.2 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.1 test/rbbt/annotations/test_util.rb
rbbt-util-5.34.0 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.21 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.20 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.19 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.18 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.17 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.16 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.15 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.14 test/rbbt/annotations/test_util.rb
rbbt-util-5.33.13 test/rbbt/annotations/test_util.rb