|
1 | | -unless RUBY_VERSION >= '1.9' |
| 1 | +require 'test_helper' |
| 2 | +require 'barby/barcode/data_matrix' |
2 | 3 |
|
3 | | - require 'test_helper' |
4 | | - require 'barby/barcode/data_matrix' |
| 4 | +class DataMatrixTest < Barby::TestCase |
5 | 5 |
|
6 | | - class DataMatrixTest < Barby::TestCase |
7 | | - |
8 | | - before do |
9 | | - @data = "humbaba" |
10 | | - @code = Barby::DataMatrix.new(@data) |
11 | | - end |
12 | | - |
13 | | - it "should have the expected encoding" do |
14 | | - @code.encoding.must_equal ["1010101010101010", "1011111000011111", "1110111000010100", |
15 | | - "1110100100000111", "1101111010101000", "1101111011110011", |
16 | | - "1111111100000100", "1100101111110001", "1001000010001010", |
17 | | - "1101010110111011", "1000000100011110", "1001010010000011", |
18 | | - "1101100111011110", "1110111010000101", "1110010110001010", |
19 | | - "1111111111111111"] |
20 | | - end |
| 6 | + before do |
| 7 | + @data = "humbaba" |
| 8 | + @code = Barby::DataMatrix.new(@data) |
| 9 | + end |
21 | 10 |
|
22 | | - it "should return data on to_s" do |
23 | | - @code.to_s.must_equal @data |
24 | | - end |
| 11 | + it "should have the expected encoding" do |
| 12 | + @code.encoding.must_equal ["1010101010101010", "1011111000011111", "1110111000010100", |
| 13 | + "1110100100000111", "1101111010101000", "1101111011110011", |
| 14 | + "1111111100000100", "1100101111110001", "1001000010001010", |
| 15 | + "1101010110111011", "1000000100011110", "1001010010000011", |
| 16 | + "1101100111011110", "1110111010000101", "1110010110001010", |
| 17 | + "1111111111111111"] |
| 18 | + end |
25 | 19 |
|
26 | | - it "should be able to change its data" do |
27 | | - prev_encoding = @code.encoding |
28 | | - @code.data = "after eight" |
29 | | - @code.encoding.wont_equal prev_encoding |
30 | | - end |
| 20 | + it "should return data on to_s" do |
| 21 | + @code.to_s.must_equal @data |
| 22 | + end |
31 | 23 |
|
| 24 | + it "should be able to change its data" do |
| 25 | + prev_encoding = @code.encoding |
| 26 | + @code.data = "after eight" |
| 27 | + @code.encoding.wont_equal prev_encoding |
32 | 28 | end |
33 | 29 |
|
34 | 30 | end |
0 commit comments