Skip to content

Commit 9f878bf

Browse files
committed
Add test cases of IRuby.table
1 parent fb1b0e4 commit 9f878bf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/iruby/utils_test.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module IRubyTest
2+
class UtilsTest < TestBase
3+
sub_test_case("IRuby.table") do
4+
def setup
5+
@data = {
6+
X: [ 1, 2, 3 ],
7+
Y: [ 4, 5, 6 ]
8+
}
9+
end
10+
sub_test_case("without header: option") do
11+
def test_table
12+
result = IRuby.table(@data)
13+
assert_include(result.object, "<th>X</th>")
14+
end
15+
end
16+
17+
sub_test_case("with header: false") do
18+
def test_table
19+
result = IRuby.table(@data, header: false)
20+
assert_not_include(result.object, "<th>X</th>")
21+
end
22+
end
23+
end
24+
end
25+
end

0 commit comments

Comments
 (0)