Sha256: 8f9e695c35131d9818c5e4e7c0b98f2eb508508914065f2038dbeb072dd135c6

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

ASCII_QR = <<EOF
...................................
.#######.##.....##.#.##....#######.
.#.....#.......##.#.##.....#.....#.
.#.###.#.#..#####..#.#..##.#.###.#.
.#.###.#.##.#....#.####.##.#.###.#.
.#.###.#.####.#....#.####..#.###.#.
.#.....#..#..#.#..#####....#.....#.
.#######.#.#.#.#.#.#.#.#.#.#######.
..........#.#.##.....##.##.........
.####..#.#....##.#.##....##..###.#.
..#.##...##.....##.#.##.#.###...##.
.#.###.##......##.#.##..##.#.###.#.
....###.#...#####..#.#...##.#...#..
.##.##.#..#.#....#.####..##.##.....
...#..#.##.##.#....#.###.##....##..
.#.######.##.#.#..#####..#######...
.#.####..###.##.#.##....#...##.#...
...##.##..###.....##.#.##.########.
.....#..###..##.....##.#########.#.
.####.#####.##.....##.#...#...#.#..
..##.#..#..#.#..#####..#.#..##...#.
...######.#####.#....#.##......#...
..###.....#..####.#....###.#...###.
.###..####.####..#.#..#######...##.
.#.#.##.##.#.....##.#.##.######.#..
..#.#######..#.##.....##.#####...#.
.........#.###.#.##.....##...#.#...
.#######....#.#.##.....###.#.#.....
.#.....#..###..#.#..######...###.#.
.#.###.#.....#.####.#...########...
.#.###.#.###...#.####.#.#.#........
.#.###.#.###..#####..#.##..#..#....
.#.....#.####.##.....##.###......#.
.#######.#.#..##.#.##...#.##...#...
...................................
EOF

describe "ZPNG png2ascii" do
  it "should have QR examples" do
    Dir[File.join(SAMPLES_DIR,'qr_*.png')].should_not be_empty
  end
  Dir[File.join(SAMPLES_DIR,'qr_*.png')].each do |fname|
    describe fname do
      it "generates a nice ascii img" do
        ZPNG::Image.new(fname).to_ascii('#.').strip.should == ASCII_QR.strip
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zpng-0.2.1 spec/ascii_spec.rb
zpng-0.2.0 spec/ascii_spec.rb