Skip to content

Commit f23838f

Browse files
author
Jerry Cheung
committed
convert to test/unit
1 parent a2ff68f commit f23838f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

test/ber/core_ext/test_array.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
require 'spec_helper'
2-
require 'metaid'
1+
require 'common'
32

4-
describe Array, "when extended with BER core extensions" do
5-
6-
it "should correctly convert a control code array" do
3+
class TestBERArrayExtension < Test::Unit::TestCase
4+
def test_control_code_array
75
control_codes = []
86
control_codes << ['1.2.3'.to_ber, true.to_ber].to_ber_sequence
97
control_codes << ['1.7.9'.to_ber, false.to_ber].to_ber_sequence
108
control_codes = control_codes.to_ber_sequence
119
res = [['1.2.3', true],['1.7.9',false]].to_ber_control
12-
res.should eq(control_codes)
10+
assert_equal control_codes, res
1311
end
1412

15-
it "should wrap the array in another array if a nested array is not passed" do
13+
def test_wrap_array_if_not_nested
1614
result1 = ['1.2.3', true].to_ber_control
1715
result2 = [['1.2.3', true]].to_ber_control
18-
result1.should eq(result2)
16+
assert_equal result2, result1
1917
end
2018

21-
it "should return an empty string if an empty array is passed" do
22-
[].to_ber_control.should be_empty
19+
def test_empty_string_if_empty_array
20+
assert_equal "", [].to_ber_control
2321
end
2422
end

0 commit comments

Comments
 (0)