Skip to content

Commit 2d044b6

Browse files
author
Camilo Lopez
committed
splitting tests logically
1 parent b80186c commit 2d044b6

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

test/test_document.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require './test/helper'
2+
require './lib/svmredlight'
3+
4+
include SVMLight
5+
6+
class TestDocument < Test::Unit::TestCase
7+
def test_create
8+
assert d = Document.create(0, 0.5, [1.0, 0, 0, 0, 0.5])
9+
end
10+
11+
def test_create_with_no_array
12+
assert_raise(TypeError) { Document.create(-1, 0, {}) }
13+
end
14+
15+
def test_create_with_empty_array
16+
assert_raise(ArgumentError) { Document.create(-1, 0, [])}
17+
end
18+
end
19+

test/test_svmredlight.rb renamed to test/test_model.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
require './test/helper'
22
require './lib/svmredlight'
33

4-
include SVMLight
5-
6-
class TestDocument < Test::Unit::TestCase
7-
def test_create
8-
assert d = Document.create(0, 0.5, [1.0, 0, 0, 0, 0.5])
9-
end
10-
11-
def test_create_with_no_array
12-
assert_raise(TypeError) { Document.create(-1, 0, {}) }
13-
end
14-
15-
def test_create_with_empty_array
16-
assert_raise(ArgumentError) { Document.create(-1, 0, [])}
17-
end
18-
end
19-
204
class TestModel < Test::Unit::TestCase
215
def test_read
226
assert m = Model.read_from_file('test/model')

0 commit comments

Comments
 (0)