From 35ba94fe6ba3fa9aa9dce364521417b7cbbb7b94 Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 29 Jun 2009 23:18:44 +0000 Subject: Added LinesOfCode encoder (issue #123) - simple version. --- test/functional/basic.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/functional/basic.rb') diff --git a/test/functional/basic.rb b/test/functional/basic.rb index ed4b3cc..bdb8608 100755 --- a/test/functional/basic.rb +++ b/test/functional/basic.rb @@ -35,6 +35,36 @@ class BasicTest < Test::Unit::TestCase CodeRay::Duo[:plain, :plain].highlight(RUBY_TEST_CODE, :stream => true)) end + def test_comment_filter + assert_equal <<-EXPECTED, CodeRay.scan(<<-INPUT, :ruby).comment_filter.text +#!/usr/bin/env ruby + +code + +more code + EXPECTED +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + INPUT + end + + def test_lines_of_code + assert_equal 2, CodeRay.scan(<<-INPUT, :ruby).lines_of_code +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + INPUT + end + begin require 'rubygems' gem 'RedCloth', '>= 4.0.3' rescue nil -- cgit v1.2.1