barby 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/test/code_25_test.rb CHANGED
@@ -9,75 +9,75 @@ class Code25Test < Barby::TestCase
9
9
  end
10
10
 
11
11
  it "should return the same data it was given" do
12
- @code.data.must_equal @data
12
+ assert_equal @data, @code.data
13
13
  end
14
14
 
15
15
  it "should have the expected characters" do
16
- @code.characters.must_equal %w(1 2 3 4 5 6 7)
16
+ assert_equal %w(1 2 3 4 5 6 7), @code.characters
17
17
  end
18
18
 
19
19
  it "should have the expected characters_with_checksum" do
20
- @code.characters_with_checksum.must_equal %w(1 2 3 4 5 6 7 0)
20
+ assert_equal %w(1 2 3 4 5 6 7 0), @code.characters_with_checksum
21
21
  end
22
22
 
23
23
  it "should have the expected digits" do
24
- @code.digits.must_equal [1,2,3,4,5,6,7]
24
+ assert_equal [1,2,3,4,5,6,7], @code.digits
25
25
  end
26
26
 
27
27
  it "should have the expected digits_with_checksum" do
28
- @code.digits_with_checksum.must_equal [1,2,3,4,5,6,7,0]
28
+ assert_equal [1,2,3,4,5,6,7,0], @code.digits_with_checksum
29
29
  end
30
30
 
31
31
  it "should have the expected even_and_odd_digits" do
32
- @code.even_and_odd_digits.must_equal [[7,5,3,1], [6,4,2]]
32
+ assert_equal [[7,5,3,1], [6,4,2]], @code.even_and_odd_digits
33
33
  end
34
34
 
35
35
  it "should have the expected start_encoding" do
36
- @code.start_encoding.must_equal '1110111010'
36
+ assert_equal '1110111010', @code.start_encoding
37
37
  end
38
38
 
39
39
  it "should have the expected stop_encoding" do
40
- @code.stop_encoding.must_equal '111010111'
40
+ assert_equal '111010111', @code.stop_encoding
41
41
  end
42
42
 
43
43
  it "should have a default narrow_width of 1" do
44
- @code.narrow_width.must_equal 1
44
+ assert_equal 1, @code.narrow_width
45
45
  end
46
46
 
47
47
  it "should have a default wide_width equal to narrow_width * 3" do
48
- @code.wide_width.must_equal @code.narrow_width * 3
48
+ assert_equal @code.narrow_width * 3, @code.wide_width
49
49
  @code.narrow_width = 2
50
- @code.wide_width.must_equal 6
50
+ assert_equal 6, @code.wide_width
51
51
  end
52
52
 
53
53
  it "should have a default space_width equal to narrow_width" do
54
- @code.space_width.must_equal @code.narrow_width
54
+ assert_equal @code.narrow_width, @code.space_width
55
55
  @code.narrow_width = 23
56
- @code.space_width.must_equal 23
56
+ assert_equal 23, @code.space_width
57
57
  end
58
58
 
59
59
  it "should have the expected digit_encodings" do
60
- @code.digit_encodings.must_equal %w(11101010101110 10111010101110 11101110101010 10101110101110 11101011101010 10111011101010 10101011101110)
60
+ assert_equal %w(11101010101110 10111010101110 11101110101010 10101110101110 11101011101010 10111011101010 10101011101110), @code.digit_encodings
61
61
  end
62
62
 
63
63
  it "should have the expected digit_encodings_with_checksum" do
64
- @code.digit_encodings_with_checksum.must_equal %w(11101010101110 10111010101110 11101110101010 10101110101110 11101011101010 10111011101010 10101011101110 10101110111010)
64
+ assert_equal %w(11101010101110 10111010101110 11101110101010 10101110101110 11101011101010 10111011101010 10101011101110 10101110111010), @code.digit_encodings_with_checksum
65
65
  end
66
66
 
67
67
  it "should have the expected data_encoding" do
68
- @code.data_encoding.must_equal "11101010101110101110101011101110111010101010101110101110111010111010101011101110101010101011101110"
68
+ assert_equal "11101010101110101110101011101110111010101010101110101110111010111010101011101110101010101011101110", @code.data_encoding
69
69
  end
70
70
 
71
71
  it "should have the expected checksum" do
72
- @code.checksum.must_equal 0
72
+ assert_equal 0, @code.checksum
73
73
  end
74
74
 
75
75
  it "should have the expected checksum_encoding" do
76
- @code.checksum_encoding.must_equal '10101110111010'
76
+ assert_equal '10101110111010', @code.checksum_encoding
77
77
  end
78
78
 
79
79
  it "should have the expected encoding" do
80
- @code.encoding.must_equal "111011101011101010101110101110101011101110111010101010101110101110111010111010101011101110101010101011101110111010111"
80
+ assert_equal "111011101011101010101110101110101011101110111010101010101110101110111010111010101011101110101010101011101110111010111", @code.encoding
81
81
  end
82
82
 
83
83
  it "should be valid" do
@@ -91,20 +91,30 @@ class Code25Test < Barby::TestCase
91
91
 
92
92
  it "should raise on encoding methods that include data encoding if not valid" do
93
93
  @code.data = 'abc'
94
- lambda{ @code.encoding }.must_raise ArgumentError
95
- lambda{ @code.data_encoding }.must_raise ArgumentError
96
- lambda{ @code.data_encoding_with_checksum }.must_raise ArgumentError
97
- lambda{ @code.digit_encodings }.must_raise ArgumentError
98
- lambda{ @code.digit_encodings_with_checksum }.must_raise ArgumentError
94
+ assert_raises ArgumentError do
95
+ @code.encoding
96
+ end
97
+ assert_raises ArgumentError do
98
+ @code.data_encoding
99
+ end
100
+ assert_raises ArgumentError do
101
+ @code.data_encoding_with_checksum
102
+ end
103
+ assert_raises ArgumentError do
104
+ @code.digit_encodings
105
+ end
106
+ assert_raises ArgumentError do
107
+ @code.digit_encodings_with_checksum
108
+ end
99
109
  end
100
110
 
101
111
  it "should return all characters in sequence on to_s" do
102
- @code.to_s.must_equal @code.characters.join
112
+ assert_equal @code.characters.join, @code.to_s
103
113
  end
104
114
 
105
115
  it "should include checksum in to_s when include_checksum is true" do
106
116
  @code.include_checksum = true
107
- @code.to_s.must_equal @code.characters_with_checksum.join
117
+ assert_equal @code.characters_with_checksum.join, @code.to_s
108
118
  end
109
119
 
110
120
  end
data/test/code_39_test.rb CHANGED
@@ -13,39 +13,39 @@ class Code39Test < Barby::TestCase
13
13
  it "should yield self on initialize" do
14
14
  c1 = nil
15
15
  c2 = Code39.new('TEST'){|c| c1 = c }
16
- c1.must_equal c2
16
+ assert_equal c2, c1
17
17
  end
18
18
 
19
19
  it "should have the expected data" do
20
- @code.data.must_equal @data
20
+ assert_equal @data, @code.data
21
21
  end
22
22
 
23
23
  it "should have the expected characters" do
24
- @code.characters.must_equal @data.split(//)
24
+ assert_equal @data.split(//), @code.characters
25
25
  end
26
26
 
27
27
  it "should have the expected start_encoding" do
28
- @code.start_encoding.must_equal '100101101101'
28
+ assert_equal '100101101101', @code.start_encoding
29
29
  end
30
30
 
31
31
  it "should have the expected stop_encoding" do
32
- @code.stop_encoding.must_equal '100101101101'
32
+ assert_equal '100101101101', @code.stop_encoding
33
33
  end
34
34
 
35
35
  it "should have the expected spacing_encoding" do
36
- @code.spacing_encoding.must_equal '000'
36
+ assert_equal '000', @code.spacing_encoding
37
37
  end
38
38
 
39
39
  it "should have the expected encoded characters" do
40
- @code.encoded_characters.must_equal %w(101011011001 110101100101 101101011001 101011011001 110100101101 101001101101 110100110101 101100101011)
40
+ assert_equal %w(101011011001 110101100101 101101011001 101011011001 110100101101 101001101101 110100110101 101100101011), @code.encoded_characters
41
41
  end
42
42
 
43
43
  it "should have the expected data_encoding" do
44
- @code.data_encoding.must_equal '101011011001000110101100101000101101011001000101011011001000110100101101000101001101101000110100110101000101100101011'
44
+ assert_equal '101011011001000110101100101000101101011001000101011011001000110100101101000101001101101000110100110101000101100101011', @code.data_encoding
45
45
  end
46
46
 
47
47
  it "should have the expected encoding" do
48
- @code.encoding.must_equal '100101101101000101011011001000110101100101000101101011001000101011011001000110100101101000101001101101000110100110101000101100101011000100101101101'
48
+ assert_equal '100101101101000101011011001000110101100101000101101011001000101011011001000110100101101000101001101101000110100110101000101100101011000100101101101', @code.encoding
49
49
  end
50
50
 
51
51
  it "should be valid" do
@@ -58,13 +58,15 @@ class Code39Test < Barby::TestCase
58
58
  end
59
59
 
60
60
  it "should raise an exception when data is not valid on initialization" do
61
- lambda{ Code39.new('abc') }.must_raise(ArgumentError)
61
+ assert_raises ArgumentError do
62
+ Code39.new('abc')
63
+ end
62
64
  end
63
65
 
64
66
  it "should return all characters in sequence without checksum on to_s" do
65
- @code.to_s.must_equal @data
67
+ assert_equal @data, @code.to_s
66
68
  end
67
-
69
+
68
70
  describe "Checksumming" do
69
71
 
70
72
  before do
@@ -72,36 +74,36 @@ class Code39Test < Barby::TestCase
72
74
  end
73
75
 
74
76
  it "should have the expected checksum" do
75
- @code.checksum.must_equal 32
77
+ assert_equal 32, @code.checksum
76
78
  end
77
79
 
78
80
  it "should have the expected checksum_character" do
79
- @code.checksum_character.must_equal 'W'
81
+ assert_equal 'W', @code.checksum_character
80
82
  end
81
83
 
82
84
  it "should have the expected checksum_encoding" do
83
- @code.checksum_encoding.must_equal '110011010101'
85
+ assert_equal '110011010101', @code.checksum_encoding
84
86
  end
85
87
 
86
88
  it "should have the expected characters_with_checksum" do
87
- @code.characters_with_checksum.must_equal %w(C O D E 3 9 W)
89
+ assert_equal %w(C O D E 3 9 W), @code.characters_with_checksum
88
90
  end
89
91
 
90
92
  it "should have the expected encoded_characters_with_checksum" do
91
- @code.encoded_characters_with_checksum.must_equal %w(110110100101 110101101001 101011001011 110101100101 110110010101 101100101101 110011010101)
93
+ assert_equal %w(110110100101 110101101001 101011001011 110101100101 110110010101 101100101101 110011010101), @code.encoded_characters_with_checksum
92
94
  end
93
95
 
94
96
  it "should have the expected data_encoding_with_checksum" do
95
- @code.data_encoding_with_checksum.must_equal "110110100101011010110100101010110010110110101100101011011001010101011001011010110011010101"
97
+ assert_equal "110110100101011010110100101010110010110110101100101011011001010101011001011010110011010101", @code.data_encoding_with_checksum
96
98
  end
97
99
 
98
100
  it "should have the expected encoding_with_checksum" do
99
- @code.encoding_with_checksum.must_equal "10010110110101101101001010110101101001010101100101101101011001010110110010101010110010110101100110101010100101101101"
101
+ assert_equal "10010110110101101101001010110101101001010101100101101101011001010110110010101010110010110101100110101010100101101101", @code.encoding_with_checksum
100
102
  end
101
103
 
102
104
  it "should return the encoding with checksum when include_checksum == true" do
103
105
  @code.include_checksum = true
104
- @code.encoding.must_equal "10010110110101101101001010110101101001010101100101101101011001010110110010101010110010110101100110101010100101101101"
106
+ assert_equal "10010110110101101101001010110101101001010101100101101101011001010110110010101010110010110101100110101010100101101101", @code.encoding
105
107
  end
106
108
 
107
109
  end
@@ -114,15 +116,15 @@ class Code39Test < Barby::TestCase
114
116
  end
115
117
 
116
118
  it "should have the expected characters" do
117
- @code.characters.must_equal %w(A B C $ %)
119
+ assert_equal %w(A B C $ %), @code.characters
118
120
  end
119
121
 
120
122
  it "should have the expected encoded_characters" do
121
- @code.encoded_characters.must_equal %w(110101001011 101101001011 110110100101 100100100101 101001001001)
123
+ assert_equal %w(110101001011 101101001011 110110100101 100100100101 101001001001), @code.encoded_characters
122
124
  end
123
125
 
124
126
  it "should have the expected data_encoding" do
125
- @code.data_encoding.must_equal '1101010010110101101001011011011010010101001001001010101001001001'
127
+ assert_equal '1101010010110101101001011011011010010101001001001010101001001001', @code.data_encoding
126
128
  end
127
129
 
128
130
  it "should not be valid" do
@@ -144,20 +146,21 @@ class Code39Test < Barby::TestCase
144
146
  end
145
147
 
146
148
  it "should have the expected characters" do
147
- @code.characters.must_equal %w(% G + A + B + C % I)
149
+ assert_equal %w(% G + A + B + C % I), @code.characters
148
150
  end
149
151
 
150
152
  it "should have the expected encoded_characters" do
151
- @code.encoded_characters.must_equal %w(101001001001 101010011011 100101001001 110101001011 100101001001 101101001011 100101001001 110110100101 101001001001 101101001101)
153
+ assert_equal %w(101001001001 101010011011 100101001001 110101001011 100101001001 101101001011 100101001001 110110100101 101001001001 101101001101), @code.encoded_characters
152
154
  end
153
155
 
154
156
  it "should have the expected data_encoding" do
155
- @code.data_encoding.must_equal '101001001001010101001101101001010010010110101001011010010100100101011010010110100101001001011011010010101010010010010101101001101'
157
+ assert_equal '101001001001010101001101101001010010010110101001011010010100100101011010010110100101001001011011010010101010010010010101101001101', @code.data_encoding
156
158
  end
157
159
 
158
160
  it "should have the expected encoding" do
159
- @code.encoding.must_equal '10010110110101010010010010101010011011010010100100101101010010110100101001001'+
160
- '010110100101101001010010010110110100101010100100100101011010011010100101101101'
161
+ assert_equal '10010110110101010010010010101010011011010010100100101101010010110100101001001'+
162
+ '010110100101101001010010010110110100101010100100100101011010011010100101101101',
163
+ @code.encoding
161
164
  end
162
165
 
163
166
  it "should take a second parameter on initialize indicating it is extended" do
@@ -176,7 +179,7 @@ class Code39Test < Barby::TestCase
176
179
  end
177
180
 
178
181
  it "should return all characters in sequence without checksum on to_s" do
179
- @code.to_s.must_equal @data
182
+ assert_equal @data, @code.to_s
180
183
  end
181
184
 
182
185
  end
@@ -191,16 +194,16 @@ class Code39Test < Barby::TestCase
191
194
  end
192
195
 
193
196
  it "should have the expected encoded_characters" do
194
- @code.encoded_characters.must_equal %w(111110011001100000110011111 110011111001100000110011111 111110011111001100000110011 110000011000001100000110011 110011000001100000110000011)
197
+ assert_equal %w(111110011001100000110011111 110011111001100000110011111 111110011111001100000110011 110000011000001100000110011 110011000001100000110000011), @code.encoded_characters
195
198
  end
196
199
 
197
200
  it "should have the expected data_encoding" do
198
201
  # A SB SC S$ S%
199
- @code.data_encoding.must_equal '1111100110011000001100111110110011111001100000110011111011111001111100110000011001101100000110000011000001100110110011000001100000110000011'
202
+ assert_equal '1111100110011000001100111110110011111001100000110011111011111001111100110000011001101100000110000011000001100110110011000001100000110000011', @code.data_encoding
200
203
 
201
204
  @code.spacing = 3
202
205
  # A S B S C S $ S %
203
- @code.data_encoding.must_equal '111110011001100000110011111000110011111001100000110011111000111110011111001100000110011000110000011000001100000110011000110011000001100000110000011'
206
+ assert_equal '111110011001100000110011111000110011111001100000110011111000111110011111001100000110011000110000011000001100000110011000110011000001100000110000011', @code.data_encoding
204
207
  end
205
208
 
206
209
  end
data/test/code_93_test.rb CHANGED
@@ -10,88 +10,90 @@ class Code93Test < Barby::TestCase
10
10
  end
11
11
 
12
12
  it "should return the same data we put in" do
13
- @code.data.must_equal @data
13
+ assert_equal @data, @code.data
14
14
  end
15
15
 
16
16
  it "should have the expected characters" do
17
- @code.characters.must_equal @data.split(//)
17
+ assert_equal @data.split(//), @code.characters
18
18
  end
19
19
 
20
20
  it "should have the expected start_encoding" do
21
- @code.start_encoding.must_equal '101011110'
21
+ assert_equal '101011110', @code.start_encoding
22
22
  end
23
23
 
24
24
  it "should have the expected stop_encoding" do
25
25
  # STOP TERM
26
- @code.stop_encoding.must_equal '1010111101'
26
+ assert_equal '1010111101', @code.stop_encoding
27
27
  end
28
28
 
29
29
  it "should have the expected encoded characters" do
30
30
  # T E S T 9 3
31
- @code.encoded_characters.must_equal %w(110100110 110010010 110101100 110100110 100001010 101000010)
31
+ assert_equal %w(110100110 110010010 110101100 110100110 100001010 101000010), @code.encoded_characters
32
32
  end
33
33
 
34
34
  it "should have the expected data_encoding" do
35
35
  # T E S T 9 3
36
- @code.data_encoding.must_equal "110100110110010010110101100110100110100001010101000010"
36
+ assert_equal "110100110110010010110101100110100110100001010101000010", @code.data_encoding
37
37
  end
38
38
 
39
39
  it "should have the expected data_encoding_with_checksums" do
40
40
  # T E S T 9 3 + (C) 6 (K)
41
- @code.data_encoding_with_checksums.must_equal "110100110110010010110101100110100110100001010101000010101110110100100010"
41
+ assert_equal "110100110110010010110101100110100110100001010101000010101110110100100010", @code.data_encoding_with_checksums
42
42
  end
43
43
 
44
44
  it "should have the expected encoding" do
45
45
  # START T E S T 9 3 + (C) 6 (K) STOP TERM
46
- @code.encoding.must_equal "1010111101101001101100100101101011001101001101000010101010000101011101101001000101010111101"
46
+ assert_equal "1010111101101001101100100101101011001101001101000010101010000101011101101001000101010111101", @code.encoding
47
47
  end
48
48
 
49
49
  it "should have the expected checksum_values" do
50
- @code.checksum_values.must_equal [29, 14, 28, 29, 9, 3].reverse #!
50
+ assert_equal [29, 14, 28, 29, 9, 3].reverse, @code.checksum_values #!
51
51
  end
52
52
 
53
53
  it "should have the expected c_checksum" do
54
- @code.c_checksum.must_equal 41 #calculate this first!
54
+ assert_equal 41, #calculate this first!
55
+ @code.c_checksum
55
56
  end
56
57
 
57
58
  it "should have the expected c_checksum_character" do
58
- @code.c_checksum_character.must_equal '+'
59
+ assert_equal '+', @code.c_checksum_character
59
60
  end
60
61
 
61
62
  it "should have the expected c_checksum_encoding" do
62
- @code.c_checksum_encoding.must_equal '101110110'
63
+ assert_equal '101110110', @code.c_checksum_encoding
63
64
  end
64
65
 
65
66
  it "should have the expected checksum_values_with_c_checksum" do
66
- @code.checksum_values_with_c_checksum.must_equal [29, 14, 28, 29, 9, 3, 41].reverse #!
67
+ assert_equal [29, 14, 28, 29, 9, 3, 41].reverse, @code.checksum_values_with_c_checksum #!
67
68
  end
68
69
 
69
70
  it "should have the expected k_checksum" do
70
- @code.k_checksum.must_equal 6 #calculate this first!
71
+ assert_equal 6, #calculate this first!
72
+ @code.k_checksum
71
73
  end
72
74
 
73
75
  it "should have the expected k_checksum_character" do
74
- @code.k_checksum_character.must_equal '6'
76
+ assert_equal '6', @code.k_checksum_character
75
77
  end
76
78
 
77
79
  it "should have the expected k_checksum_encoding" do
78
- @code.k_checksum_encoding.must_equal '100100010'
80
+ assert_equal '100100010', @code.k_checksum_encoding
79
81
  end
80
82
 
81
83
  it "should have the expected checksums" do
82
- @code.checksums.must_equal [41, 6]
84
+ assert_equal [41, 6], @code.checksums
83
85
  end
84
86
 
85
87
  it "should have the expected checksum_characters" do
86
- @code.checksum_characters.must_equal ['+', '6']
88
+ assert_equal ['+', '6'], @code.checksum_characters
87
89
  end
88
90
 
89
91
  it "should have the expected checksum_encodings" do
90
- @code.checksum_encodings.must_equal %w(101110110 100100010)
92
+ assert_equal %w(101110110 100100010), @code.checksum_encodings
91
93
  end
92
94
 
93
95
  it "should have the expected checksum_encoding" do
94
- @code.checksum_encoding.must_equal '101110110100100010'
96
+ assert_equal '101110110100100010', @code.checksum_encoding
95
97
  end
96
98
 
97
99
  it "should be valid" do
@@ -103,9 +105,9 @@ class Code93Test < Barby::TestCase
103
105
  end
104
106
 
105
107
  it "should return data with no checksums on to_s" do
106
- @code.to_s.must_equal 'TEST93'
108
+ assert_equal 'TEST93', @code.to_s
107
109
  end
108
-
110
+
109
111
  describe "Extended mode" do
110
112
 
111
113
  before do
@@ -118,24 +120,25 @@ class Code93Test < Barby::TestCase
118
120
  end
119
121
 
120
122
  it "should convert extended characters to special shift characters" do
121
- @code.characters.must_equal ["E", "\304", "X", "\304", "T", "\304", "E", "\304", "N", "\304", "D", "\304", "E", "\304", "D", "\303", "A"]
123
+ assert_equal ["E", "\304", "X", "\304", "T", "\304", "E", "\304", "N", "\304", "D", "\304", "E", "\304", "D", "\303", "A"], @code.characters
122
124
  end
123
125
 
124
126
  it "should have the expected data_encoding" do
125
- @code.data_encoding.must_equal '110010010100110010101100110100110010110100110100110010110010010'+
126
- '100110010101000110100110010110010100100110010110010010100110010110010100111010110110101000'
127
+ assert_equal '110010010100110010101100110100110010110100110100110010110010010'+
128
+ '100110010101000110100110010110010100100110010110010010100110010110010100111010110110101000',
129
+ @code.data_encoding
127
130
  end
128
131
 
129
132
  it "should have the expected c_checksum" do
130
- @code.c_checksum.must_equal 9
133
+ assert_equal 9, @code.c_checksum
131
134
  end
132
135
 
133
136
  it "should have the expected k_checksum" do
134
- @code.k_checksum.must_equal 46
137
+ assert_equal 46, @code.k_checksum
135
138
  end
136
139
 
137
140
  it "should return the original data on to_s with no checksums" do
138
- @code.to_s.must_equal 'Extended!'
141
+ assert_equal 'Extended!', @code.to_s
139
142
  end
140
143
 
141
144
  end
@@ -9,22 +9,33 @@ class DataMatrixTest < Barby::TestCase
9
9
  end
10
10
 
11
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"]
12
+ assert_equal [
13
+ "10101010101010",
14
+ "10111010000001",
15
+ "11100101101100",
16
+ "11101001110001",
17
+ "11010101111110",
18
+ "11100101100001",
19
+ "11011001011110",
20
+ "10011011010011",
21
+ "11011010000100",
22
+ "10101100101001",
23
+ "11011100001100",
24
+ "10101110110111",
25
+ "11000001010100",
26
+ "11111111111111",
27
+ ],
28
+ @code.encoding
18
29
  end
19
30
 
20
31
  it "should return data on to_s" do
21
- @code.to_s.must_equal @data
32
+ assert_equal @data, @code.to_s
22
33
  end
23
34
 
24
35
  it "should be able to change its data" do
25
36
  prev_encoding = @code.encoding
26
37
  @code.data = "after eight"
27
- @code.encoding.wont_equal prev_encoding
38
+ refute_equal prev_encoding, @code.encoding
28
39
  end
29
40
 
30
41
  end