Sha256: 5327c2a4a992c26c83aea36f4c0e1b0455517f73bfcec5e530a3abaf408368d6

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

#! /usr/bin/env ruby
# coding: utf-8

require "helper"
require "stringio"

class Tefil::IndentConverter
  public :process_stream
end

class TC_IndentStatistics < Test::Unit::TestCase
  def setup
    @is00 = Tefil::IndentStatistics.new()
  end

  def test_process_stream
    # stdin -> stdout
    $stdin = StringIO.new
    $stdin.puts "a"
    $stdin.puts "  b"
    $stdin.puts "    c"
    $stdin.puts "  d"
    $stdin.puts "    e"
    $stdin.puts "    f"
    $stdin.puts "  g"
    $stdin.puts "    h"
    $stdin.rewind
    str = capture_stdout{}
    result = capture_stdout{ @is00.filter([])}
    correct =
      " 0|*\n" +
      " 2|***\n" +
      " 4|****\n"
    assert_equal(correct, result)
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tefil-0.1.1 test/test_indentstatistics.rb
tefil-0.1.0 test/test_indentstatistics.rb