~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/psych/test_emitter.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
 
3
 
require_relative 'helper'
 
3
require 'psych/helper'
4
4
 
5
5
module Psych
6
6
  class TestEmitter < TestCase
10
10
      @emitter = Psych::Emitter.new @out
11
11
    end
12
12
 
 
13
    def test_line_width
 
14
      assert_equal 0, @emitter.line_width
 
15
      assert_equal 10, @emitter.line_width = 10
 
16
      assert_equal 10, @emitter.line_width
 
17
    end
 
18
 
13
19
    def test_set_canonical
14
20
      @emitter.canonical = true
15
21
      assert_equal true, @emitter.canonical
64
70
        ['foo', Object.new, nil, false, true, 1],
65
71
        ['foo', nil, Object.new, false, true, 1],
66
72
        ['foo', nil, nil, false, true, :foo],
 
73
        [nil, nil, nil, false, true, 1],
67
74
      ].each do |args|
68
75
        assert_raises(TypeError) do
69
76
          @emitter.scalar(*args)