Sha256: c677cd03a2b738022db13d4be25bcc162abc30b06556b8f9ad1b5914dc08ea0d

Contents?: true

Size: 848 Bytes

Versions: 15

Compression:

Stored size: 848 Bytes

Contents

require 'helper'

module Syck
  class TestException < Test::Unit::TestCase
    class Wups < Exception
      attr_reader :foo, :bar
      def initialize *args
        super
        @foo = 1
        @bar = 2
      end
    end

    def setup
      @wups = Wups.new('test_message')
    end

    def test_to_yaml
      w = Syck.load(Syck.dump(@wups))
      assert_equal @wups, w
      assert_equal 1, w.foo
      assert_equal 2, w.bar
    end

    def test_dump
      w = Syck.load(Syck.dump(@wups))
      assert_equal @wups, w
      assert_equal 1, w.foo
      assert_equal 2, w.bar
    end

    def test_to_yaml_properties
      class << @wups
        def to_yaml_properties
          [:@foo]
        end
      end

      w = Syck.load(Syck.dump(@wups))
      assert_equal @wups, w
      assert_equal 1, w.foo
      assert_nil w.bar
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
syck-1.5.1.1 test/test_exception.rb
syck-1.5.1 test/test_exception.rb
syck-1.5.0 test/test_exception.rb
syck-1.4.1 test/test_exception.rb
syck-1.4.0 test/test_exception.rb
syck-1.3.0 test/test_exception.rb
syck-1.2.0 test/test_exception.rb
syck-1.1.0 test/test_exception.rb
syck-1.0.5 test/test_exception.rb
syck-1.0.4 test/test_exception.rb
syck-1.0.3 test/test_exception.rb
syck-1.0.1 test/test_exception.rb
syck-1.0.0.4 test/test_exception.rb
concordia-publishing-house-syck-1.0.0.4 test/test_exception.rb
syck-1.0.0 test/test_exception.rb