debian/tests/smoke-test
raw| 1 | #!/usr/bin/ruby |
| 2 | |
| 3 | require 'asciiart' |
| 4 | require 'test/unit' |
| 5 | |
| 6 | class TestAsciiArt < Test::Unit::TestCase |
| 7 | def file(filename) |
| 8 | File.join(File.dirname(__FILE__), filename) |
| 9 | end |
| 10 | |
| 11 | def test_basics |
| 12 | art = AsciiArt.new(file("debian.png")) |
| 13 | assert_equal File.read(file("debian.txt")), art.to_ascii_art |
| 14 | end |
| 15 | |
| 16 | def test_32 |
| 17 | art = AsciiArt.new(file("debian.png")) |
| 18 | assert_equal File.read(file("debian-32.txt")), art.to_ascii_art(width: 32) |
| 19 | end |
| 20 | end |